假设我们有这样一个proxy
http://user:pass@url:port
(1)export这个proxy
export ALL_PROXY=http://user:pass@url:port
(2)就可以使用如下命令来下载文件
curl -# -O -L https://huggingface.co/WizardLM/WizardCoder-15B-V1.0/resolve/main/pytorch_model.bin?download=true
(1)配置git proxy
git config --global http://user:pass@url:port
(2)使用git来clone
git clone https://huggingface.co/WizardLM/WizardCoder-15B-V1.0
import os
proxy = 'http://user:pass@url:port'
os.environ['http_proxy'] = proxy
os.environ['HTTP_PROXY'] = proxy
os.environ['https_proxy'] = proxy
os.environ['HTTPS_PROXY'] = proxy
然后再调用keras-nlp只来的模块来下载模型(在google drive上),就能正常工作了。