Skip to content

Commit ed70c70

Browse files
authored
modelscope: fix issue when model parameter is not a model id but path of the model. (#2489)
1 parent f0d4e14 commit ed70c70

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

vllm/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ def __init__(
9393
# download model from ModelScope hub,
9494
# lazy import so that modelscope is not required for normal use.
9595
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
99102
self.model = model_path
100103
self.download_dir = model_path
101104
self.tokenizer = model_path

0 commit comments

Comments
 (0)