UKPLab / sentence-transformers

Multilingual Sentence & Image Embeddings with BERT
https://www.SBERT.net
Apache License 2.0
14.69k stars 2.42k forks source link

No sentence-transformers model found with name sentence-transformers/all-MiniLM-L6-v2. #2664

Open weirdo-onlooker opened 3 months ago

weirdo-onlooker commented 3 months ago

During the execution of my code: model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2') definition_embeddings = model.encode(DSE_infos)

I encountered the following error, and the same issue occurred with multiple models: No sentence-transformers model found with name sentence-transformers/all-MiniLM-L6-v2. Creating a new one with MEAN pooling. /root/miniconda3/envs/sentence-bert/lib/python3.9/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True. ... ... ... OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like sentence-transformers/all-MiniLM-L6-v2 is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

tomaarsen commented 3 months ago

Hello!

It seems like https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 was not accessible for you. Could you try to:

  1. Rerun your code? Perhaps Hugging Face was down for a minute. I can access HF now, so that might just resolve it already.
  2. Verify whether you can access https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/blob/main/config.json. Can you browse to this URL without issues?
  3. Could you try and wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/raw/main/config.json to download this file?

If you have issues with all of those, then perhaps you're behind some firewall that prevents access to Hugging Face? Please let me know what happens when you try the above.