Skip to content

http retries on audio file downloads#45126

Merged
tarekziade merged 5 commits intomainfrom
tarekziade-torchcodec-retry
Apr 9, 2026
Merged

http retries on audio file downloads#45126
tarekziade merged 5 commits intomainfrom
tarekziade-torchcodec-retry

Conversation

@tarekziade
Copy link
Copy Markdown
Collaborator

What does this PR do?

This patch adds exponential back-off for load_audio_librosa / load_audio_as / load_audio_torchcodec
when they try to download a file.

That generic utility is also used within hub_retry

notice that there were no streaming done before, so I kept the same logic.

@tarekziade tarekziade requested a review from eustlb March 30, 2026 16:34
@tarekziade tarekziade self-assigned this Mar 30, 2026
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread src/transformers/testing_utils.py
Comment thread tests/utils/test_generic.py
Copy link
Copy Markdown
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice change!

See DM internally for a nit.

@tarekziade tarekziade added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 9, 2026
@tarekziade tarekziade added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 25c80bc Apr 9, 2026
29 checks passed
@tarekziade tarekziade deleted the tarekziade-torchcodec-retry branch April 9, 2026 15:12
sirzechs66 pushed a commit to sirzechs66/transformers that referenced this pull request Apr 18, 2026
* http retries on lib audio file downloads

* cleanups: the retry decorator is not http specific and the hub had redundant exceptions

* docstrings and sleep assertion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants