Skip to content

Conversation

@Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Nov 4, 2025

The current snapshot_download and hf download output is very verbose. We have 2-3 messages per file + 1 progress bar per file. On most repos, it makes the output unreadable. This PR fixes that by switching the "downloading file to ...", "moving file to ...", "file in cache", etc. messages to DEBUG level instead of INFO, and by combining all per-file progress bars into a single one. In practice this "bytes downloading" progress bar is only an estimate because we can't know in advance how much bytes will be downloaded. It is still a much better indicator than before (in my opinion^^).

As a side effect, this PR adds a tqdm_class parameter to hf_hub_download to control progress bar for individual files (as already the case in snapshot_download).

Here is a recording of how it looks like in the terminal:

Screencast.from.04-11-2025.15.10.07.webm

It should also greatly improve the output in non-TTY env, typically Spaces (cc @cbensimon)

@Wauplin Wauplin requested a review from hanouticelina November 4, 2025 15:08
@HuggingFaceDocBuilderDev

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.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

tested it locally, it looks great! thank you

# This progress bar is shared across threads/files and gets updated each time we fetch
# metadata for a file.
bytes_progress = tqdm_class(
desc="Downloading (incomplete total...)",
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) maybe a clearer wording?

Suggested change
desc="Downloading (incomplete total...)",
desc="Downloading (total size unknown...)",

@Wauplin Wauplin merged commit ede63d1 into main Nov 4, 2025
24 checks passed
@Wauplin Wauplin deleted the aggregated-snapshot-download-bar branch November 4, 2025 16:14
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.

4 participants