"git@developer.sourcefind.cn:OpenDAS/apex.git" did not exist on "fa183ee8eabe115215fd5a18e6b6cea836261ab4"
Commit 28b47e60 authored by Bruce MacDonald's avatar Bruce MacDonald
Browse files

accurate loading bar for resume download

parent 61e39bf5
...@@ -90,7 +90,7 @@ def download_file(download_url, models_home, location, file_size): ...@@ -90,7 +90,7 @@ def download_file(download_url, models_home, location, file_size):
response = requests.get(download_url, headers=header, stream=True) response = requests.get(download_url, headers=header, stream=True)
response.raise_for_status() response.raise_for_status()
total_size = int(response.headers.get('content-length', 0)) total_size = int(response.headers.get('content-length', 0)) + first_byte
with open(local_filename, 'ab' if first_byte else 'wb') as file, tqdm( with open(local_filename, 'ab' if first_byte else 'wb') as file, tqdm(
total=total_size, total=total_size,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment