vllm/use_existing_torch.py
Chukwuma Nwaugha 17a9abec2b
simplify requires_files list creation (#29656)
Signed-off-by: Chukwuma Nwaugha <nwaughac@gmail.com>
2025-12-06 09:42:41 +00:00

19 lines
596 B
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import glob
for file in (*glob.glob("requirements/*.txt"), "pyproject.toml"):
print(f">>> cleaning {file}")
with open(file) as f:
lines = f.readlines()
if "torch" in "".join(lines).lower():
print("removed:")
with open(file, "w") as f:
for line in lines:
if "torch" not in line.lower():
f.write(line)
else:
print(line.strip())
print(f"<<< done cleaning {file}\n")