Skip to content

Commit 476fa0b

Browse files
authored
Add 500 HTTP Error to retry list (#2567)
* Add 500 error to retry list * Add 500 error to retry list
1 parent 8d1ffc6 commit 476fa0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/huggingface_hub/hf_file_system.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def _fetch_range(self, start: int, end: int) -> bytes:
714714
"GET",
715715
url,
716716
headers=headers,
717-
retry_on_status_codes=(502, 503, 504),
717+
retry_on_status_codes=(500, 502, 503, 504),
718718
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
719719
)
720720
hf_raise_for_status(r)
@@ -813,7 +813,7 @@ def read(self, length: int = -1):
813813
"GET",
814814
url,
815815
headers=self.fs._api._build_hf_headers(),
816-
retry_on_status_codes=(502, 503, 504),
816+
retry_on_status_codes=(500, 502, 503, 504),
817817
stream=True,
818818
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
819819
)
@@ -835,7 +835,7 @@ def read(self, length: int = -1):
835835
"GET",
836836
url,
837837
headers={"Range": "bytes=%d-" % self.loc, **self.fs._api._build_hf_headers()},
838-
retry_on_status_codes=(502, 503, 504),
838+
retry_on_status_codes=(500, 502, 503, 504),
839839
stream=True,
840840
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
841841
)

0 commit comments

Comments
 (0)