解决 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
posted @   七三七3  阅读(9321)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示