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
Hide 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,17 +3,21 @@
from
vllm.envs
import
VLLM_USE_MODELSCOPE
if
VLLM_USE_MODELSCOPE
:
# Patch here, before each import happens
import
modelscope
from
packaging
import
version
try
:
# 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 -U`'
)
from
modelscope.utils.hf_util
import
patch_hub
# 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 -U`'
)
from
modelscope.utils.hf_util
import
patch_hub
# Patch hub to download models from modelscope to speed up.
patch_hub
()
# Patch hub to download models from modelscope to speed up.
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