forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Fix code for downloading models from modelscope (vllm-projec…
- Loading branch information
1 parent
b699a93
commit d7fa079
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from vllm.envs import VLLM_USE_MODELSCOPE | ||
|
||
if VLLM_USE_MODELSCOPE: | ||
# 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>=1.18.1`') | ||
|
||
from modelscope.utils.hf_util import patch_hub | ||
|
||
# Patch hub to download models from modelscope to speed up. | ||
patch_hub() |