Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Add scaling to tqdm bar when downloading files #5397

Merged
merged 1 commit into from
Sep 7, 2021
Merged

Conversation

Rexhaif
Copy link
Contributor

@Rexhaif Rexhaif commented Sep 5, 2021

Changes proposed in this pull request:

  • Adds unit scaling to Tqdm bar when it is used to track file downloading progress

Rationale:

Seeing million-like numbers in the tqdm bar when downloading large files is quite non-informative. I think that scaled units will be way more useful, as we see them daily while downloading files in the browser of checking connectivity speed on speedtest. Fortunately, tqdm has scaling features that convert numbers to their scaled variants like 12304556B -> 12,3MB.

That is used in other libraries, which deal with pretrained models, for example huggingface/transformers.

Before submitting

After submitting

  • All GitHub Actions jobs for my pull request have passed.
  • codecov/patch reports high test coverage (at least 90%).
    You can find this under the "Actions" tab of the pull request once the other checks have finished.

Copy link
Member

@epwalsh epwalsh left a comment

Choose a reason for hiding this comment

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

Thanks @Rexhaif, this is great!

@epwalsh epwalsh enabled auto-merge (squash) September 7, 2021 21:19
@epwalsh epwalsh merged commit 5338bd8 into allenai:main Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants