thib00
October 17, 2024, 7:41am
1
I am trying to load a model with langchain-huggingface using the following
from langchain_huggingface.embeddings.huggingface import HuggingFaceEmbeddings
model = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
I get the following error
ReadTimeout: (ReadTimeoutError("HTTPSConnectionPool(host='cdn-lfs.hf.co', port=443): Read timed out. (read timeout=10)"), '(Request ID: e8e18c49-82ab-4c61-8d6e-d478f16e6136)')
I have also tried to load the model with other packages but I still get the same error.
Does anyone have an idea why this happens and how I can resolve this ?
Thanks
1 Like
hi @thib00
I just tried for langchain and HF, and it works for both now. It might be a temporary glitch.
the reference repo runwayml/stable-diffusion-v1-5
doesn’t exist anymore.
In your case, the situation is a little different from his, and the very repo you’re trying to load has disappeared.
Try this stable-diffusion-v1-5/stable-diffusion-v1-5
thib00
October 18, 2024, 7:57am
5
Thanks for the answer, but it still does not work on my side.
Yours appears to be a network, mainly SSL issue.
opened 02:29AM - 08 Jul 21 UTC
closed 03:01PM - 15 Aug 21 UTC
Dear,
I am new in Transformers, I just tried to run the syntax below:
from … transformers import BertForSequenceClassification, AdamW, BertConfig
model = BertForSequenceClassification.from_pretrained(
"bert-base-cased",
num_labels = 2,
output_attentions = False,
output_hidden_states = False
)
model.cuda()
However, I got an error message like:
`HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Max retries exceeded with url: /bert-base-cased/d6992b8cd27d7a132eafce6a8210272329a371b1c762d453588795dd3
835593e (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff9e60c6dd0>: Failed to establish a new connection: [Errno -2] Name or service
not known'))
Traceback (most recent call last):
File "/root/anaconda3/envs/bert/lib/python3.7/site-packages/urllib3/connection.py", line 170, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/root/anaconda3/envs/bert/lib/python3.7/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/root/anaconda3/envs/bert/lib/python3.7/socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
`
Any suggestions on how to fix it?
Kind regards,
MY
2 fixes
quick one - on windows - pip install python-certifi-win32
preferred - install transformers package using the following command
pip install transformers --use-feature=truststore
1 Like