A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 17, 05:30 UTC
modelscope: fix issue when model parameter is not a model id but path of the model. (#2489)
liuyhwangyh committed
Feb 7, 2024 at 01:57 UTC
ed70c70ea3569670499717f06d117ed25ec32af4
1 file changed
+6
-3
vllm/config.py
+6
-3
@@ -93,9 +93,12 @@ class ModelConfig:
93
# download model from ModelScope hub,
94
# lazy import so that modelscope is not required for normal use.
95
from modelscope.hub.snapshot_download import snapshot_download # pylint: disable=C
96
- model_path = snapshot_download(model_id=model,
97
- cache_dir=download_dir,
98
- revision=revision)
96
+ if not os.path.exists(model):
97
+ model_path = snapshot_download(model_id=model,
98
+ cache_dir=download_dir,
99
+ revision=revision)
100
+ else:
101
+ model_path = model
102
self.model = model_path
103
self.download_dir = model_path
104
self.tokenizer = model_path