{"id":1020,"hash":"b45c42b0624ca3b2c3f8e09469a285d57d7cb1dddb86f1cda34f31ad5a7c1ff0","pattern":"Facing SSL Error with Huggingface pretrained models","full_message":"I am facing below issue while loading the pretrained model from HuggingFace.\n\nHTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /roberta-base/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)')))\n\nThe line that is causing the issue is\n\ntokenizer = AutoTokenizer.from_pretrained('roberta-base')\n\nI never faced this issue before and it was working absolutely fine earlier. I am clueless.","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"Adding the following to the top of the code worked for me:\n\nimport requests\nfrom huggingface_hub import configure_http_backend\n\ndef backend_factory() -> requests.Session:\n    session = requests.Session()\n    session.verify = False\n    return session\n\nconfigure_http_backend(backend_factory=backend_factory)","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/71692354/facing-ssl-error-with-huggingface-pretrained-models","votes":33,"created_at":"2026-04-19T04:52:12.288604+00:00","updated_at":"2026-04-19T04:52:12.288604+00:00"}