Curl update (#3004)

* Curl update

* Curl update
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-05-01 17:29:51 +02:00
1 parent 4d7bca7648
commit 37eaffec7d
3 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ def attempt_download(file, repo='ultralytics/yolov5'):
assert redundant, 'No secondary mirror'
url = f'https://storage.googleapis.com/{repo}/ckpt/{name}'
print(f'Downloading {url} to {file}...')
os.system(f'curl -L {url} -o {file}') # torch.hub.download_url_to_file(url, weights)
os.system(f"curl -L '{url}' -o '{file}' --retry 3 -C -") # curl download, retry and resume on fail
finally:
if not file.exists() or file.stat().st_size < 1E6: # check
file.unlink(missing_ok=True) # remove partial downloads