"csrc/vscode:/vscode.git/clone" did not exist on "82857368400bcf6a12a3d42a3ccdc5f585153404"
Unverified Commit 7ea6cb28 authored by Jee Jee Li's avatar Jee Jee Li Committed by GitHub
Browse files

[Misc] Improve modelscope import error (#17983)


Signed-off-by: default avatarJee Jee Li <pandaleefree@gmail.com>
parent 9fbf2bfb
......@@ -3,6 +3,7 @@
from vllm.envs import VLLM_USE_MODELSCOPE
if VLLM_USE_MODELSCOPE:
try:
# Patch here, before each import happens
import modelscope
from packaging import version
......@@ -12,8 +13,11 @@ if VLLM_USE_MODELSCOPE:
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()
except ImportError as err:
raise ImportError(
"Please install modelscope>=1.18.1 via "
"`pip install modelscope>=1.18.1` to use ModelScope.") from err
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment