Do not move downloaded zips (#9455)

* Do not move downloaded zips

Prevent multiple downloads on HUB of same dataset

@kalenmike 

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update general.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/9454/head^2
Glenn Jocher 2022-09-17 15:19:43 +02:00 committed by GitHub
parent 5e1a9553fb
commit 4a4308001c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -568,10 +568,10 @@ def download(url, dir='.', unzip=True, delete=True, curl=False, threads=1, retry
def download_one(url, dir):
# Download 1 file
success = True
f = dir / Path(url).name # filename
if Path(url).is_file(): # exists in current path
Path(url).rename(f) # move to dir
elif not f.exists():
if Path(url).is_file():
f = Path(url) # filename
else: # does not exist
f = dir / Path(url).name
LOGGER.info(f'Downloading {url} to {f}...')
for i in range(retry + 1):
if curl: