Update audio_data.py
Browse files- audio_data.py +9 -9
audio_data.py
CHANGED
|
@@ -79,17 +79,17 @@ class AudioData(datasets.GeneratorBasedBuilder):
|
|
| 79 |
|
| 80 |
def _split_generators(self, dl_manager):
|
| 81 |
|
| 82 |
-
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
|
| 94 |
|
| 95 |
def _generate_examples(self, split, data_dir):
|
|
|
|
| 79 |
|
| 80 |
def _split_generators(self, dl_manager):
|
| 81 |
|
| 82 |
+
data_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
|
| 83 |
|
| 84 |
+
if not os.path.exists(data_dir):
|
| 85 |
+
raise FileNotFoundError(
|
| 86 |
+
f"{data_dir} does not exist. Make sure you insert a manual dir via `datasets.load_dataset('timit_asr', data_dir=...)` that includes files unzipped from the TIMIT zip. Manual download instructions: {self.manual_download_instructions}"
|
| 87 |
+
)
|
| 88 |
|
| 89 |
+
return [
|
| 90 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"split": "train", "data_dir": data_dir}),
|
| 91 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"split": "test", "data_dir": data_dir}),
|
| 92 |
+
]
|
| 93 |
|
| 94 |
|
| 95 |
def _generate_examples(self, split, data_dir):
|