vllm启动模型缺少huggingface文件,离线手动下载导入到~/.cache/huggingface/hub目录下

307 阅读1分钟

使用vllm启动本地模型时报错如下:

Could not locate the configuration_deepseek.py inside deepseek-ai/DeepSeek-Coder-V2-Instruct-0724.
Traceback (most recent call last):
  File "/home/test/vllm/.new_venv/lib/python3.12/site-packages/transformers/utils/hub.py", line 424, in cached_files
    hf_hub_download(
  File "/home/test/vllm/.new_venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/test/vllm/.new_venv/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/vllm/.new_venv/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1068, in _hf_hub_download_to_cache_dir
    _raise_on_head_call_error(head_call_error, force_download, local_files_only)
  File "/home/test/vllm/.new_venv/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1587, in _raise_on_head_call_error
    raise LocalEntryNotFoundError(
huggingface_hub.errors.LocalEntryNotFoundError: Cannot find the requested files in the disk cache and outgoing traffic has been disabled. To enable hf.co look-ups and downloads online, set 'local_files_only' to False.

由于网络原因,手动下载缺少的文件到~/.cache/huggingface/hub目录下 1./refs目录(存放git hash)

image.png

2.存放具体缺少的文件 /snapshots/{git hash}/ image.png

然后启动即可解决报错问题