【秒解决:huggingface_hub.utils._errors.LocalEntryNotFoundError】

报错详细

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

问题说明

在使用到huggingface时,下载连接不稳定导致,ConnectError。

解决方式

1)在python代码中加入

os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"

2)在命令行中设置环境变量

HF_ENDPOINT=https://hf-mirror.com python xxx.py

参考链接:https://github.com/Stability-AI/generative-models/issues/215#issuecomment-1960803222

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐