解决huggingface.co访问失败问题
解决不能访问huggingface.co的问题
·
深度学习的项目经常需要上huggingface.co上下载模型,存在本地的/.cache/huggingface下,以便后续调用。但是经常运行中下载时,碰到以下报错:

解决方案:
1)cd /root/miniconda3/lib/python3. 10/site-packages/huggingface_hub/constants.py,打开constants.py文件,搜索查找huggingface.co,并替换为hf-mirror.com,保存退出。
(如果创建了虚拟环境timesfmcp311,则可参考这样操作:
cd D:\anaconda3\envs\timesfmcp311\Lib\site-packages\huggingface_hub/constants.py,以下相同)
2)cd /root/miniconda3/lib/python3.10/site-packages/transformers/utils/hub.py,打开hub.py文件,搜索查找huggingface.co,并替换为hf-mirror.com,保存退出。
更多推荐


所有评论(0)