Skip to content

Commit

Permalink
modelscope: fix issue when model parameter is not a model id but path…
Browse files Browse the repository at this point in the history
… of the model. (vllm-project#2489)
  • Loading branch information
liuyhwangyh authored and jimpang committed Mar 4, 2024
1 parent 19cecc4 commit 9361cb7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ def __init__(
# download model from ModelScope hub,
# lazy import so that modelscope is not required for normal use.
from modelscope.hub.snapshot_download import snapshot_download # pylint: disable=C
model_path = snapshot_download(model_id=model,
cache_dir=download_dir,
revision=revision)
if not os.path.exists(model):
model_path = snapshot_download(model_id=model,
cache_dir=download_dir,
revision=revision)
else:
model_path = model
self.model = model_path
self.download_dir = model_path
self.tokenizer = model_path
Expand Down

0 comments on commit 9361cb7

Please sign in to comment.