Skip to content

Commit d7bc5d7

Browse files
authored
Add .tar support for datasets (#8963)
1 parent 3fc8999 commit d7bc5d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utils/general.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,12 @@ def download_one(url, dir):
594594
else:
595595
LOGGER.warning(f'Failed to download {url}...')
596596

597-
if unzip and success and f.suffix in ('.zip', '.gz'):
597+
if unzip and success and f.suffix in ('.zip', '.tar', '.gz'):
598598
LOGGER.info(f'Unzipping {f}...')
599599
if f.suffix == '.zip':
600600
ZipFile(f).extractall(path=dir) # unzip
601+
elif f.suffix == '.tar':
602+
os.system(f'tar xf {f} --directory {f.parent}') # unzip
601603
elif f.suffix == '.gz':
602604
os.system(f'tar xfz {f} --directory {f.parent}') # unzip
603605
if delete:

0 commit comments

Comments
 (0)