Skip to content

Commit

Permalink
Add 500 HTTP Error to retry list (#2567)
Browse files Browse the repository at this point in the history
* Add 500 error to retry list

* Add 500 error to retry list
  • Loading branch information
farzadab authored Sep 27, 2024
1 parent 8d1ffc6 commit 476fa0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/huggingface_hub/hf_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def _fetch_range(self, start: int, end: int) -> bytes:
"GET",
url,
headers=headers,
retry_on_status_codes=(502, 503, 504),
retry_on_status_codes=(500, 502, 503, 504),
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
)
hf_raise_for_status(r)
Expand Down Expand Up @@ -813,7 +813,7 @@ def read(self, length: int = -1):
"GET",
url,
headers=self.fs._api._build_hf_headers(),
retry_on_status_codes=(502, 503, 504),
retry_on_status_codes=(500, 502, 503, 504),
stream=True,
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
)
Expand All @@ -835,7 +835,7 @@ def read(self, length: int = -1):
"GET",
url,
headers={"Range": "bytes=%d-" % self.loc, **self.fs._api._build_hf_headers()},
retry_on_status_codes=(502, 503, 504),
retry_on_status_codes=(500, 502, 503, 504),
stream=True,
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
)
Expand Down

0 comments on commit 476fa0b

Please sign in to comment.