Can't install the model locally (configuration_bert.py)
Want to run the model locally.
Got the following error message:
404 Client Error: Entry Not Found for url: https://huggingface.co/jinaai/jina-embeddings-v2-base-en/resolve/main/jinaai/jina-bert-implementation--configuration_bert.py
--
!pip install transformers
!pip install langchain
from transformers import AutoModel
from numpy.linalg import norm
cos_sim = lambda a,b: (a @ b.T) / (norm(a)*norm(b))
model = AutoModel.from_pretrained('jinaai/jina-embeddings-v2-base-en', trust_remote_code=True) # trust_remote_code is needed to use the encode method
....
Which version of transformers package are you using?
Try updating your transformers package version to the latest. I had a similar issue when I was using an older version of transformers. Updating the package and clearing the older cache files fixed the issue.
Hi, thanks a lot for the prompt reply.
Transformers version: Name: transformers, Version: 4.20.0 (I upgraded it, as you advised).
I removed the entire folder from: C:\Users\joann.cache\torch\sentence_transformers. I got the same error. Then I changed the code to force the download:
from transformers import AutoModel
from numpy.linalg import norm
model = AutoModel.from_pretrained('jinaai/jina-embeddings-v2-base-en', trust_remote_code=True, force_download=True) # trust_remote_code is needed to use the encode method
The model is not being downloaded. See the screenshots below.
Explicitly passing a revision
is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Could not locate the jinaai/jina-bert-implementation--configuration_bert.py inside jinaai/jina-embeddings-v2-base-en.
<...>
EntryNotFoundError: 404 Client Error: Entry Not Found for url: https://huggingface.co/jinaai/jina-embeddings-v2-base-en/resolve/main/jinaai/jina-bert-implementation--configuration_bert.py
Solved, closing the discussion
Encountered the same problem, how did you solve it?
@LightFire
make sure to upgrade transformers to the latest version using
pip install -U transformers`
@LightFire make sure to upgrade
transformers to the latest version using
pip install -U transformers`
Thanks for your reply, I finally chose to let Hugging Face download the files directly to my local instead of utilizing git clone.