# ReadTimeoutError when loading model

**URL:** <https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481>\
**Category:** Beginners\
**Created:** [October 17, 2024, 7:41am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481 "2024-10-17T07:41:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thib00](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@thib00](https://discuss.huggingface.co/u/thib00)\
**Post date:** [October 17, 2024, 7:41am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/1 "2024-10-17T07:41:48Z")

</div>

I am trying to load a model with langchain-huggingface using the following

```auto
from langchain_huggingface.embeddings.huggingface import HuggingFaceEmbeddings
model = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")

```

I get the following error

```auto
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

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/52583_2.png) [@mahmutc](https://discuss.huggingface.co/u/mahmutc)\
**Post date:** [October 17, 2024, 9:40am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/2 "2024-10-17T09:40:12Z")

</div>

hi @thib00  
I just tried for langchain and HF, and it works for both now. It might be a temporary glitch.

---

<div class="post-metadata">

**Author:** ![jijingdeyi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jijingdeyi/32/33041_2.png) [@jijingdeyi](https://discuss.huggingface.co/u/jijingdeyi)\
**Post date:** [October 17, 2024, 11:26am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/3 "2024-10-17T11:26:15Z")

</div>

![vscode](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/d/2d184ec74acdf4a5d121a4c0bcbb8b773019789f.png)  
I have similar problems

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 17, 2024, 11:43am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/4 "2024-10-17T11:43:17Z")

</div>

> **[@dn6 on Hugging Face: "Sharing for anyone using Diffusers \`from\_single\_file\`...](https://huggingface.co/posts/dn6/357701279407928)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> 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`

---

<div class="post-metadata">

**Author:** ![thib00](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@thib00](https://discuss.huggingface.co/u/thib00)\
**Post date:** [October 18, 2024, 7:57am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/5 "2024-10-18T07:57:10Z")

</div>

Thanks for the answer, but it still does not work on my side.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 18, 2024, 8:00am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/6 "2024-10-18T08:00:49Z")

</div>

Yours appears to be a network, mainly SSL issue.

> <https://github.com/huggingface/transformers/issues/12575>
>
> 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

> [@SSL Certificate Issue](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/7):
>
> 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
