Skip to content

Commit 740f064

Browse files
authored
Reinstate existing torch script (vllm-project#24729)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
1 parent 01413e0 commit 740f064

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

use_existing_torch.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4-
print("vLLM is now using 'uv' to disable build isolation for 'torch'.")
5-
print("Please instead install vLLM with 'uv pip install -e .' (must use 'uv')")
4+
import glob
5+
6+
requires_files = glob.glob('requirements/*.txt')
7+
requires_files += ["pyproject.toml"]
8+
for file in requires_files:
9+
print(f">>> cleaning {file}")
10+
with open(file) as f:
11+
lines = f.readlines()
12+
if "torch" in "".join(lines).lower():
13+
print("removed:")
14+
with open(file, 'w') as f:
15+
for line in lines:
16+
if 'torch' not in line.lower():
17+
f.write(line)
18+
else:
19+
print(line.strip())
20+
print(f"<<< done cleaning {file}")
21+
print()

0 commit comments

Comments
 (0)