Spaces:
Runtime error
Runtime error
Commit
·
8a74fe1
1
Parent(s):
87c4a7b
same fix
Browse files- src/utils/data_utils.py +2 -1
src/utils/data_utils.py
CHANGED
|
@@ -24,7 +24,8 @@ def download_personal_hf_dataset(name):
|
|
| 24 |
|
| 25 |
def unzip_file(file_path,destination_dir):
|
| 26 |
"""unzips file to destination_dir"""
|
| 27 |
-
|
|
|
|
| 28 |
os.makedirs(destination_dir)
|
| 29 |
with ZipFile(file_path,"r") as zip:
|
| 30 |
zip.extractall(destination_dir)
|
|
|
|
| 24 |
|
| 25 |
def unzip_file(file_path,destination_dir):
|
| 26 |
"""unzips file to destination_dir"""
|
| 27 |
+
if os.path.exists(destination_dir):
|
| 28 |
+
shutil.rmtree(destination_dir)
|
| 29 |
os.makedirs(destination_dir)
|
| 30 |
with ZipFile(file_path,"r") as zip:
|
| 31 |
zip.extractall(destination_dir)
|