File tree 1 file changed +16
-12
lines changed
1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 3
3
from vllm .envs import VLLM_USE_MODELSCOPE
4
4
5
5
if VLLM_USE_MODELSCOPE :
6
- # Patch here, before each import happens
7
- import modelscope
8
- from packaging import version
6
+ try :
7
+ # Patch here, before each import happens
8
+ import modelscope
9
+ from packaging import version
9
10
10
- # patch_hub begins from modelscope>=1.18.1
11
- if version .parse (modelscope .__version__ ) <= version .parse ('1.18.0' ):
12
- raise ImportError (
13
- 'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
14
- 'install by `pip install modelscope -U`' )
15
-
16
- from modelscope .utils .hf_util import patch_hub
11
+ # patch_hub begins from modelscope>=1.18.1
12
+ if version .parse (modelscope .__version__ ) <= version .parse ('1.18.0' ):
13
+ raise ImportError (
14
+ 'Using vLLM with ModelScope needs modelscope>=1.18.1, please '
15
+ 'install by `pip install modelscope -U`' )
16
+ from modelscope .utils .hf_util import patch_hub
17
17
18
- # Patch hub to download models from modelscope to speed up.
19
- patch_hub ()
18
+ # Patch hub to download models from modelscope to speed up.
19
+ patch_hub ()
20
+ except ImportError as err :
21
+ raise ImportError (
22
+ "Please install modelscope>=1.18.1 via "
23
+ "`pip install modelscope>=1.18.1` to use ModelScope." ) from err
You can’t perform that action at this time.
0 commit comments