# SSLError: Cannot instantiate a HuggingFace model

**URL:** <https://discuss.huggingface.co/t/sslerror-cannot-instantiate-a-huggingface-model/75797>\
**Category:** Beginners\
**Created:** [March 4, 2024, 9:47am UTC](https://discuss.huggingface.co/t/sslerror-cannot-instantiate-a-huggingface-model/75797 "2024-03-04T09:47:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asheru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@asheru](https://discuss.huggingface.co/u/asheru)\
**Post date:** [March 4, 2024, 9:47am UTC](https://discuss.huggingface.co/t/sslerror-cannot-instantiate-a-huggingface-model/75797/1 "2024-03-04T09:47:56Z")

</div>

Code:  
tokenizer = transformers.T5Tokenizer.from\_pretrained(MODEL\_NAME)  
Result:  
SSLError: HTTPSConnectionPool(host=‘[huggingface.co](http://huggingface.co)’, port=443): Max retries exceeded with url: /bigscience/mt0-large/resolve/main/spiece.model (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: unable to get local issuer certificate (\_ssl.c:1091)’)))

Note the problem occurs for many model names, e.g., “bigscience/mt0-large”  
Note following a search in Google, I use requests==2.27.1 and  
import os  
os.environ[‘CURL\_CA\_BUNDLE’] = ‘’  
BUT IT DID NOT HELP!  
Thnak you

---

<div class="post-metadata">

**Author:** ![GM2091](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@GM2091](https://discuss.huggingface.co/u/GM2091)\
**Post date:** [June 11, 2024, 7:10pm UTC](https://discuss.huggingface.co/t/sslerror-cannot-instantiate-a-huggingface-model/75797/2 "2024-06-11T19:10:29Z")

</div>

`pip install pip_system_certs`  
After this the model download will use your system trust store instead of whatever it is using by default.
