Skip to content

Commit

Permalink
[Bugfix] Fix code for downloading models from modelscope (vllm-projec…
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet authored and MengqingCao committed Sep 30, 2024
1 parent b699a93 commit d7fa079
Showing 1 changed file with 17 additions and 0 deletions.
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()

0 comments on commit d7fa079

Please sign in to comment.