Skip to content

Commit 8ac369e

Browse files
tastelikefeetsumitd2
authored andcommitted
[Bugfix] Fix code for downloading models from modelscope (vllm-project#8443)
Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
1 parent e9e714a commit 8ac369e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

vllm/transformers_utils/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from vllm.envs import VLLM_USE_MODELSCOPE
2+
3+
if VLLM_USE_MODELSCOPE:
4+
# Patch here, before each import happens
5+
import modelscope
6+
from packaging import version
7+
8+
# patch_hub begins from modelscope>=1.18.1
9+
if version.parse(modelscope.__version__) <= version.parse('1.18.0'):
10+
raise ImportError(
11+
'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
12+
'install by `pip install modelscope>=1.18.1`')
13+
14+
from modelscope.utils.hf_util import patch_hub
15+
16+
# Patch hub to download models from modelscope to speed up.
17+
patch_hub()

0 commit comments

Comments
 (0)