SSLError: Cannot instantiate a HuggingFace model

Code:
tokenizer = transformers.T5Tokenizer.from_pretrained(MODEL_NAME)
Result:
SSLError: HTTPSConnectionPool(host=‘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

2 Likes