小编Nik*_*iya的帖子

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): 超过最大重试次数,网址:/dslim/bert-base-NER/resolve/main/tokenizer_config.json

由于 SSL 证书错误,我在从 HuggingFace 加载预训练的 BERT 模型时遇到以下问题。

错误:

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): 超过最大重试次数,网址为:/dslim/bert-base-NER/resolve/main/tokenizer_config.json (由 SSLError(SSLCertVerificationError(1, '[ SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:证书链中的自签名证书 (_ssl.c:1108)')))

导致问题的行是:

tokenizer = AutoTokenizer.from_pretrained("dslim/bert-base-NER")
Run Code Online (Sandbox Code Playgroud)

源代码:

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dslim/bert-base-NER")
model = AutoModelForTokenClassification.from_pretrained("dslim/bert-base-NER")
Run Code Online (Sandbox Code Playgroud)

我希望在 Windows 上的 jupyter 实验室中运行代码时下载预先训练的模型。

python-3.x bert-language-model huggingface-transformers huggingface-tokenizers huggingface

11
推荐指数
2
解决办法
3万
查看次数