Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix code for downloading models from modelscope #8443

Merged
merged 15 commits into from
Sep 28, 2024
17 changes: 17 additions & 0 deletions vllm/transformers_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from vllm.envs import VLLM_USE_MODELSCOPE

if VLLM_USE_MODELSCOPE:
# Patch here, before each import happens
import modelscope
from packaging import version

# patch_hub begins from modelscope>=1.18.1
if version.parse(modelscope.__version__) <= version.parse('1.18.0'):
raise ImportError(
'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
'install by `pip install modelscope>=1.18.1`')

from modelscope.utils.hf_util import patch_hub

# Patch hub to download models from modelscope to speed up.
patch_hub()
Loading