Skip to content

Commit

Permalink
[BUG] Fix progress bar unit. (#3177)
Browse files Browse the repository at this point in the history
  • Loading branch information
46319943 committed Apr 20, 2023
1 parent 6ffd3e4 commit 5a0103b
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 5a0103b

Please sign in to comment.