解决 huggingface下载连接不稳定导致ConnectError问题
问题:在huggingface下载预训练模型权重时出现连接错误
命令行运行:
huggingface-cli download time-series-foundation-models/Lag-Llama lag-llama.ckpt --local-dir content/lag-llama
出现报错:
'huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.'
解决方法:
import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
!huggingface-cli download time-series-foundation-models/Lag-Llama lag-llama.ckpt --local-dir content/lag-llama
或者是在命令行加入
HF_ENDPOINT=https://hf-mirror.com python xxx.py
https://hf-mirrors.com
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 Eternal Night
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果