Port 433 Time out error
Hi all.
When executing the CPU code example, I think there's an error.
For downloading the pre-trained model, it seems that there's an error below.
I look like it stems from the website connection to the pre-trained model.
The error msg is the same as below.
Would you plz let me know if there's any way to solve it?
Downloading: 65%|βββββββββββββββββββββββββββββββ | 6.46G/9.99G [11:37<06:15, 9.41MB/s]Traceback (most recent call last):
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 443, in _error_catcher
yield
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 566, in read
data = self._fp_read(amt) if not fp_closed else b""
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 524, in _fp_read
data = self._fp.read(chunk_amt)
File "/opt/conda/lib/python3.8/http/client.py", line 459, in read
n = self.readinto(b)
File "/opt/conda/lib/python3.8/http/client.py", line 503, in readinto
n = self.fp.readinto(b)
File "/opt/conda/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/opt/conda/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/opt/conda/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/hugging_face/hf/lib/python3.8/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 627, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 592, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/opt/conda/lib/python3.8/contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "/root/hugging_face/hf/lib/python3.8/site-packages/urllib3/response.py", line 448, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Read timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "example.py", line 20, in
model = SwitchTransformersForConditionalGeneration.from_pretrained("google/switch-large-128")
File "/root/hugging_face/hf/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2173, in from_pretrained
resolved_archive_file, sharded_metadata = get_checkpoint_shard_files(
File "/root/hugging_face/hf/lib/python3.8/site-packages/transformers/utils/hub.py", line 924, in get_checkpoint_shard_files
cached_filename = cached_file(
File "/root/hugging_face/hf/lib/python3.8/site-packages/transformers/utils/hub.py", line 409, in cached_file
resolved_file = hf_hub_download(
File "/root/hugging_face/hf/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/root/hugging_face/hf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1240, in hf_hub_download
http_get(
File "/root/hugging_face/hf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 493, in http_get
for chunk in r.iter_content(chunk_size=1024):
File "/root/hugging_face/hf/lib/python3.8/site-packages/requests/models.py", line 822, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Read timed out.
Downloading: 65%|βββββββββββββββββββββββββββββββ | 6.46G/9.99G [11:47<06:27, 9.13MB/s]
Thanks for your message!
This is quite strange and seems to be related to connectivity issues, does this issue happen when you try it multiple times?
@ybelkada
Yes, it is. It does happen multiple times and stops at the same point exactly.
It can be easily solved by adding args "resume_download"
where do we add "resume_download".