Skip to content

Commit d6374cd

Browse files
add retry for preupload endpoint (#3588)
1 parent 8626c56 commit d6374cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/huggingface_hub/_commit_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
fetch_xet_connection_info_from_repo_info,
2828
get_session,
2929
hf_raise_for_status,
30+
http_backoff,
3031
logging,
3132
sha,
3233
tqdm_stream_file,
@@ -739,7 +740,8 @@ def _fetch_upload_modes(
739740
if gitignore_content is not None:
740741
payload["gitIgnore"] = gitignore_content
741742

742-
resp = get_session().post(
743+
resp = http_backoff(
744+
"POST",
743745
f"{endpoint}/api/{repo_type}s/{repo_id}/preupload/{revision}",
744746
json=payload,
745747
headers=headers,

0 commit comments

Comments
 (0)