Skip to content

Commit 3881212

Browse files
throw error instead of auto install
1 parent 04906ab commit 3881212

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/test_vllm.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ class TestLoadVLLM(ModelTest):
3737

3838
@classmethod
3939
def setUpClass(self):
40-
if importlib.util.find_spec("flashinfer") is None:
41-
subprocess.check_call([sys.executable, "-m", "pip", "install", "flashinfer", "-i",
42-
f"https://flashinfer.ai/whl/cu{torch.version.cuda.replace('.', '')}/torch{'.'.join(torch.__version__.split('.')[:2])}"])
43-
44-
if importlib.util.find_spec("vllm") is None:
45-
subprocess.check_call([sys.executable, "-m", "pip", "install", "vllm>=0.6.2"])
40+
if ((importlib.util.find_spec("flashinfer") is None and importlib.util.find_spec("flashinfer-python") is None) or
41+
importlib.util.find_spec("vllm") is None):
42+
raise RuntimeError("flashinfer and vllm are required by this test. you can install them by `pip install gptqmodel['vllm']`")
4643

4744
from vllm import SamplingParams # noqa: E402
4845
self.MODEL_ID = "/monster/data/model/TinyLlama-1.1B-Chat-v1.0-GPTQ-4bit"

0 commit comments

Comments
 (0)