UKPLab / sentence-transformers

State-of-the-Art Text Embeddings
https://www.sbert.net
Apache License 2.0
15.26k stars 2.47k forks source link

Getting an SSL error when instanciating model #1497

Open scunden opened 2 years ago

scunden commented 2 years ago

Getting an SSL error when trying to instantiate the model. Installed the module through pip install sentence-transformers. Current version is 2.2, python version 3.9.7

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: unable to get local issuer certificate (_ssl.c:1129)')))

from sentence_transformers import SentenceTransformer

sentences = [
    "Three years later, the coffin was still full of Jello.",
    "The fish dreamed of escaping the fishbowl and into the toilet where he saw his friend go.",
    "The person box was packed with jelly many dozens of months later.",
    "Standing on one's head at job interviews forms a lasting impression.",
    "It took him a month to finish the meal.",
    "He found a leprechaun in his walnut shell."
]

model = SentenceTransformer('bert-base-nli-mean-tokens')
sentence_embeddings = model.encode(sentences)
ScottishFold007 commented 2 years ago

Not surprisingly, there is something wrong with your network...

scunden commented 2 years ago

Can you further clarify? How can I go about finding out what is going on?