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

Commit

Permalink
Add scaling to tqdm bar when downloading files (#5397)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexhaif authored Sep 7, 2021
1 parent c7bdf6e commit 5338bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion allennlp/common/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def _http_get(url: str, temp_file: IO) -> None:
req.raise_for_status()
content_length = req.headers.get("Content-Length")
total = int(content_length) if content_length is not None else None
progress = Tqdm.tqdm(unit="B", total=total, desc="downloading")
progress = Tqdm.tqdm(unit="B", unit_scale=True, total=total, desc="downloading")
for chunk in req.iter_content(chunk_size=1024):
if chunk: # filter out keep-alive new chunks
progress.update(len(chunk))
Expand Down

0 comments on commit 5338bd8

Please sign in to comment.