Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7ea6cb28
Unverified
Commit
7ea6cb28
authored
May 12, 2025
by
Jee Jee Li
Committed by
GitHub
May 12, 2025
Browse files
[Misc] Improve modelscope import error (#17983)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
9fbf2bfb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
vllm/transformers_utils/__init__.py
vllm/transformers_utils/__init__.py
+16
-12
No files found.
vllm/transformers_utils/__init__.py
View file @
7ea6cb28
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
vllm.envs
import
VLLM_USE_MODELSCOPE
from
vllm.envs
import
VLLM_USE_MODELSCOPE
if
VLLM_USE_MODELSCOPE
:
if
VLLM_USE_MODELSCOPE
:
try
:
# Patch here, before each import happens
# Patch here, before each import happens
import
modelscope
import
modelscope
from
packaging
import
version
from
packaging
import
version
...
@@ -12,8 +13,11 @@ if VLLM_USE_MODELSCOPE:
...
@@ -12,8 +13,11 @@ if VLLM_USE_MODELSCOPE:
raise
ImportError
(
raise
ImportError
(
'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
'install by `pip install modelscope -U`'
)
'install by `pip install modelscope -U`'
)
from
modelscope.utils.hf_util
import
patch_hub
from
modelscope.utils.hf_util
import
patch_hub
# Patch hub to download models from modelscope to speed up.
# Patch hub to download models from modelscope to speed up.
patch_hub
()
patch_hub
()
except
ImportError
as
err
:
raise
ImportError
(
"Please install modelscope>=1.18.1 via "
"`pip install modelscope>=1.18.1` to use ModelScope."
)
from
err
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment