THUDM / ChatGLM2-6B

ChatGLM2-6B: An Open Bilingual Chat LLM | 开源双语对话语言模型
Other
15.74k stars 1.85k forks source link

[Feature] <title>模型无法访问https://huggingface.co/报错403 #532

Open shenleqinau opened 1 year ago

shenleqinau commented 1 year ago

Is your feature request related to a problem? Please describe.

raise SSLError(e, request=request) requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /THUDM/chatglm2-6b/resolve/main/tokenizer_config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))"), '(Request ID: 369e970a-5970-47e4-b457-1fd45186f2bf)')

Solutions

使用代理

Additional context

No response

hiddenblue commented 1 year ago

huggingface最近好像被封了。最好自己从清华云盘下载,可以按照下面的步骤 把下面7个模型文件下载下来,这些是国内的服务器链接 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00001-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00002-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00003-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00004-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00005-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00006-of-00007.bin&dl=1 https://cloud.tsinghua.edu.cn/d/674208019e314311ab5c/files/?p=%2Fchatglm2-6b%2Fpytorch_model-00007-of-00007.bin&dl=1

然后把huggingface页面里面,手动把除了模型之外的文件都下载下来 记得一定要下载这些小文件 https://huggingface.co/THUDM/chatglm2-6b/tree/main

模型和这些小文件放到一个文件夹里面,把路径填到运行的代码里面替换掉,"THUDM/chatglm2-6b"

tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True, device='cuda')

然后就能运行了

charwavid commented 1 year ago

huggingface现在根本就访问不了了,小文件还怎么下?还好我有备份,就是不知道代码里有没有连接huggingface。等了三天,我还以为只是我的网络被限,原来都访问不了。话说回来,为什么国内开发的代码一定要放国外呢,特别是大数据模型这种敏感数据,别搞不好让当通敌处理了?!

evyy1234 commented 1 year ago

为什么我加载了本地模型,运行时还是会报访问huggingface超时的提示呢

hiddenblue commented 1 year ago

为什么我加载了本地模型,运行时还是会报访问huggingface超时的提示呢

除了模型文件还需要hf上那些小的文件,json之类的,需要在运行的程序里面修改模型的路径