__init__.py 578 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
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 '
12
            'install by `pip install modelscope -U`')
13
14
15
16
17

    from modelscope.utils.hf_util import patch_hub

    # Patch hub to download models from modelscope to speed up.
    patch_hub()