Using huggingface CLI with a certificate
Hello, I am trying to download models through the Huggingface CLI from within a somewhat protected environment. In that environment, which I access through Citrix, I need to specify a certificate when I do python package installations viapip install --cert mycert.pem themoduleWhen I go to use huggingface-cli login I am able to specify my token, and it appears that my token gets appropriately checked because my responses are different depending on whether I pass a valid token or not. However, rather than logging in, I get the following error:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘huggingface.co’, port=443): Max retries exceeded with url: /api/whoami-v2 (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)’)))This appears to be related to the certificate issue, but I don’t know how to specify the certificate like I do for pip. Perhaps I need to ninja my way into some of the huggingface-cli code and specify my cert there?Any help would be appreciated. Am currently at a loss for how I will pass models into this environment (I have some ideas, but they are definitely doing it the hard way).
2024-09-29T06:52:43Z
github.com/huggingface/transformersSSLError: HTTPSConnectionPool(host='huggingface.co', port=443)opened03:46PM - 08 Jun 22 UTCclosed03:02PM - 15 Aug 22 UTCalexsomozaI'm trying in python:

from sentence_transformers import SentenceTransformer…sbert_model = SentenceTransformer('all-MiniLM-L6-v2')

and I get this error:

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/all-MiniLM-L6-v2 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

I have no proxy, just getting direct to internet !!!Wow…there are so many patterns of problems it’s going to be hard to isolate them.
2024-09-29T11:52:33Z
I might not have read down far enough in that thread because I think my problem actually IS a proxy, though I’m not really sure. I didn’t see any option there that actually allowed you to specify a certificate, which seemed to be the issue with pip.I’ll look into some of the options in that thread, though it would be ideal if there were simply a way to specify the certificate. To be clear, this is not really my area of expertise so there might be an easy answer and I just don’t see it.Edit: Ah, I see that this thread includes many folks with proxy issues. ::sigh:: ok… hold my beer, I am going in…
2024-09-30T00:32:27Z
When a lot of people lament about some problem, there’s often something buggy in there…Anyway, something is not working as it is supposed to.I’ve never messed with SSL certificates…Like this one?stackoverflow.comFacing SSL Error with Huggingface pretrained modelspython-3.x, tensorflow2.0, huggingface-transformers, huggingface-tokenizersasked bychaituon12:19PM - 31 Mar 22 UTCSSL Certificate Issue🤗TransformersError :   SSLError: HTTPSConnectionPool(host=‘huggingface.co’, port=443): Max retries exceeded with url:  / (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Unable to get local issuer certificate (ssl.c:997)’))) 
Python Script 
from transformers import AutoTokenizer 
from transformers import TFAutoModelForMaskedLM 
tokenizer = AutoTokenizer.from_pretrained(‘distilroberta-base’) 
model_checkpoint = ‘distilbert-base-uncased’ 
model = TFAu…