Skip to content

Commit

Permalink
fix a bug that time duration may be 0 when downloading model binary
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Nov 11, 2015
1 parent 19028e7 commit f9970c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/download_model_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def reporthook(count, block_size, total_size):
if count == 0:
start_time = time.time()
return
duration = time.time() - start_time
duration = (time.time() - start_time) or 0.01
progress_size = int(count * block_size)
speed = int(progress_size / (1024 * duration))
percent = int(count * block_size * 100 / total_size)
Expand Down

0 comments on commit f9970c8

Please sign in to comment.