问题:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /Salesforce/blip-image-captioning-base/resolve/main/preprocessor_config.json (Caused by ProxyError('Cannot connect to proxy.', timeout('timed out')))
原因:
Hugface为外网,国内无法连接
解决方法:
1.安装依赖
pip install -U huggingface_hub
2.设置环境变量
Linux
export HF_ENDPOINT=https://hf-mirror.com
Windows:
$env:HF_ENDPOINT = "https://hf-mirror.com"