HuggingFace模型下载错误
First Post:
Last Update:
Word Count:
Read Time:
Page View: loading...
Last Update:
Word Count:
208
Read Time:
1 min
Page View: loading...
问题
在执行下载模型时出现http连接错误1
HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /xlm-roberta-large/resolve/main/config.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f00c74d8880>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
解决
简单粗暴(不知道什么时候不能用)
直接进行一个库降级的操作1
2pip install requests==2.27.1
pip install urllib3==1.25.11
添加代理
在自己的代码中添加一个网络代理1
2
3
4import os
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"
直接下载(最傻逼的方法, 不到万不得已别用)
- 打开浏览器
- 输入模型地址
- 按下回车, 等待页面加载
- 点击下载按钮
- 将下载得到的模型文件移动到自己的目录