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>
This commit is contained in:
1 parent
5e1a9553fb
commit
4a4308001c
1 file changed
+4
-4
+4
-4
@@ -568,10 +568,10 @@ def download(url, dir='.', unzip=True, delete=True, curl=False, threads=1, retry
|
|||||||
def download_one(url, dir):
|
def download_one(url, dir):
|
||||||
# Download 1 file
|
# Download 1 file
|
||||||
success = True
|
success = True
|
||||||
f = dir / Path(url).name # filename
|
if Path(url).is_file():
|
||||||
if Path(url).is_file(): # exists in current path
|
f = Path(url) # filename
|
||||||
Path(url).rename(f) # move to dir
|
else: # does not exist
|
||||||
elif not f.exists():
|
f = dir / Path(url).name
|
||||||
LOGGER.info(f'Downloading {url} to {f}...')
|
LOGGER.info(f'Downloading {url} to {f}...')
|
||||||
for i in range(retry + 1):
|
for i in range(retry + 1):
|
||||||
if curl:
|
if curl:
|
||||||
|
|||||||
Reference in new issue
Block a user