Skip to content

Commit

Permalink
Do not move downloaded zips (#9455)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
glenn-jocher committed Sep 17, 2022
1 parent 5e1a955 commit 4a43080
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4a43080

Please sign in to comment.