科学上网,但仍无法从huggingface上下载模型,解决。
科学上网,但仍无法从huggingface上下载模型,解决。
问题:
不连梯子超时,连了梯子说ProxyError始终无法从huggingface上下载模型
提示类似如下一些错误:
Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1149)
OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like roberta-large is not the path to a directory conta
ining a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/whoami-v2 (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)')))"), '(Request ID: f66616a1-b118-4772-aa46-3a07b80492cb)')
解决:
安装 urllib3
pip install urllib3==1.25.11
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 刘哥还在学