Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 080d669

Browse files
liuyhwangyhalexm-redhat
authored andcommitted
modelscope: fix issue when model parameter is not a model id but path of the model. (vllm-project#2489)
1 parent 66f6d9d commit 080d669

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
@@ -95,9 +95,12 @@ def __init__(
9595
# download model from ModelScope hub,
9696
# lazy import so that modelscope is not required for normal use.
9797
from modelscope.hub.snapshot_download import snapshot_download # pylint: disable=C
98-
model_path = snapshot_download(model_id=model,
99-
cache_dir=download_dir,
100-
revision=revision)
98+
if not os.path.exists(model):
99+
model_path = snapshot_download(model_id=model,
100+
cache_dir=download_dir,
101+
revision=revision)
102+
else:
103+
model_path = model
101104
self.model = model_path
102105
self.download_dir = model_path
103106
self.tokenizer = model_path

0 commit comments

Comments
 (0)