Skip to content

Commit

Permalink
[BUG] Fix progress bar unit. (PaddlePaddle#3177)
Browse files Browse the repository at this point in the history
  • Loading branch information
46319943 authored and luotao1 committed Jun 11, 2024
1 parent cf8727b commit 6e63998
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddlespeech/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def _get_download(url, fullname):
total_size = req.headers.get('content-length')
with open(tmp_fullname, 'wb') as f:
if total_size:
with tqdm(total=(int(total_size) + 1023) // 1024) as pbar:
with tqdm(total=(int(total_size)), unit='B', unit_scale=True) as pbar:
for chunk in req.iter_content(chunk_size=1024):
f.write(chunk)
pbar.update(1)
pbar.update(len(chunk))
else:
for chunk in req.iter_content(chunk_size=1024):
if chunk:
Expand Down

0 comments on commit 6e63998

Please sign in to comment.