SSL certificate error when downloading model weights
I'm getting the below error when downloading model weights
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)>
Specifically I'm calling CLIP via llama-index and this is the full stack trace: https://gist.github.com/linminhtoo/b613ffc916e5e96329169e8b4601eff5
Any ideas? I'm on Mac and I could download other pretrained weights from HuggingFace etc without issues
In file /Path/to/your/virtualenvs/envs/inpainting/lib/python3.8/site-packages/clip/clip.py
temporarily modify the following lines:
with urllib.request.urlopen(url) as source, open(download_target, "wb") as output:
to
import ssl
context = ssl._create_unverified_context()
with urllib.request.urlopen(url, context=context) as source, open(download_target, "wb") as output:
In file
/Path/to/your/virtualenvs/envs/inpainting/lib/python3.8/site-packages/clip/clip.pytemporarily modify the following lines:with urllib.request.urlopen(url) as source, open(download_target, "wb") as output:to
import ssl context = ssl._create_unverified_context() with urllib.request.urlopen(url, context=context) as source, open(download_target, "wb") as output:
Cool, that works. Because the 'clip' is installed from source code, I changed the source code /clip/clip.py@line59 before I install it