首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ktrain包中使用Bert时的SSLCertVerificationError

在ktrain包中使用Bert时的SSLCertVerificationError
EN

Stack Overflow用户
提问于 2021-07-09 20:16:10
回答 1查看 88关注 0票数 1

我正在使用jupyter中的ktrain包和this notebook提供的代码。我在qa = text.SimpleQA(INDEXDIR)行得到一个错误。这个错误很长,但下面是一个简短的版本:

代码语言:javascript
复制
HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)')))
HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)')))

OSError: Can't load config for 'bert-large-uncased-whole-word-masking-finetuned-squad'. Make sure that:

- 'bert-large-uncased-whole-word-masking-finetuned-squad' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'bert-large-uncased-whole-word-masking-finetuned-squad' is the correct path to a directory containing a config.json file

我可以在我的浏览器上访问https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json。我完全不知道该做什么--我的编码技能充其量也就是最低限度,所以任何建议都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-14 10:19:46

我的猜测是,你的公司内部网在所有https流量上插入了一个“中间人”。我猜下面的代码现在也会给你同样的错误:

代码语言:javascript
复制
import requests
requests.get('https://www.huggingface.co')

如果您从IT部门获得CA证书捆绑包,并且您使用的是Windows,则可以尝试执行以下操作:

代码语言:javascript
复制
import os
os.environ['REQUESTS_CA_BUNDLE'] = 'path/to/certificates_ca_bundle.crt'
qa = text.SimpleQA(INDEXDIR)

如果在Linux上,请使用these instructions安装证书。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68316635

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档