kaushal98b
commited on
Commit
·
3d86fd5
1
Parent(s):
5728ae1
Update kathbath.py
Browse files- kathbath.py +9 -2
kathbath.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
import csv
|
4 |
import os
|
|
|
5 |
|
6 |
import datasets
|
7 |
from datasets.utils.py_utils import size_str
|
@@ -111,10 +112,16 @@ class Kathbath(datasets.GeneratorBasedBuilder):
|
|
111 |
f"{_DATA_URL}/audio_{split}.tar.partab",
|
112 |
f"{_DATA_URL}/audio_{split}.tar.partac",
|
113 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
else:
|
115 |
audio_paths = [f"{_DATA_URL}/audio_{split}.tar"]
|
116 |
-
|
117 |
-
|
118 |
metadata_path[split] = dl_manager.download(f"{_DATA_URL}/metadata_{split}.tsv")
|
119 |
path_to_clips = "kb_data_clean_m4a"
|
120 |
|
|
|
2 |
|
3 |
import csv
|
4 |
import os
|
5 |
+
import tarfile
|
6 |
|
7 |
import datasets
|
8 |
from datasets.utils.py_utils import size_str
|
|
|
112 |
f"{_DATA_URL}/audio_{split}.tar.partab",
|
113 |
f"{_DATA_URL}/audio_{split}.tar.partac",
|
114 |
]
|
115 |
+
audio_path[split] = dl_manager.download(audio_paths)
|
116 |
+
for path in audio_path[split]:
|
117 |
+
try:
|
118 |
+
local_extracted_archive[split] = dl_manager.extract(audio_path[split]) if not dl_manager.is_streaming else None
|
119 |
+
except tarfile.ReadError:
|
120 |
+
pass
|
121 |
else:
|
122 |
audio_paths = [f"{_DATA_URL}/audio_{split}.tar"]
|
123 |
+
audio_path[split] = dl_manager.download(audio_paths)
|
124 |
+
local_extracted_archive[split] = dl_manager.extract(audio_path[split]) if not dl_manager.is_streaming else None
|
125 |
metadata_path[split] = dl_manager.download(f"{_DATA_URL}/metadata_{split}.tsv")
|
126 |
path_to_clips = "kb_data_clean_m4a"
|
127 |
|