解决 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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~