restructured the splits
Browse files- librivox-indonesia.py +5 -5
librivox-indonesia.py
CHANGED
@@ -108,23 +108,23 @@ class LibriVoxIndonesia(datasets.GeneratorBasedBuilder):
|
|
108 |
audio = {}
|
109 |
local_extracted_archive = {}
|
110 |
metadata_path = {}
|
111 |
-
|
112 |
-
for split in
|
113 |
-
audio[split] = dl_manager.download(f"{_DATA_URL}/
|
114 |
local_extracted_archive[split] = dl_manager.extract(audio[split]) if not dl_manager.is_streaming else None
|
115 |
metadata_path[split] = dl_manager.download_and_extract(f"{_DATA_URL}/metadata_{split}.csv.gz")
|
116 |
path_to_clips = "librivox-indonesia"
|
117 |
|
118 |
return [
|
119 |
datasets.SplitGenerator(
|
120 |
-
name=
|
121 |
gen_kwargs={
|
122 |
"local_extracted_archive": local_extracted_archive[split],
|
123 |
"audio_files": dl_manager.iter_archive(audio[split]),
|
124 |
"metadata_path": dl_manager.download_and_extract(metadata_path[split]),
|
125 |
"path_to_clips": path_to_clips,
|
126 |
},
|
127 |
-
) for split in
|
128 |
]
|
129 |
|
130 |
def _generate_examples(
|
|
|
108 |
audio = {}
|
109 |
local_extracted_archive = {}
|
110 |
metadata_path = {}
|
111 |
+
split_type = {"train": datasets.Split.TRAIN, "test": datasets.Split.TEST}
|
112 |
+
for split in split_type:
|
113 |
+
audio[split] = dl_manager.download(f"{_DATA_URL}/audio_{split}.tgz")
|
114 |
local_extracted_archive[split] = dl_manager.extract(audio[split]) if not dl_manager.is_streaming else None
|
115 |
metadata_path[split] = dl_manager.download_and_extract(f"{_DATA_URL}/metadata_{split}.csv.gz")
|
116 |
path_to_clips = "librivox-indonesia"
|
117 |
|
118 |
return [
|
119 |
datasets.SplitGenerator(
|
120 |
+
name=split_type[split],
|
121 |
gen_kwargs={
|
122 |
"local_extracted_archive": local_extracted_archive[split],
|
123 |
"audio_files": dl_manager.iter_archive(audio[split]),
|
124 |
"metadata_path": dl_manager.download_and_extract(metadata_path[split]),
|
125 |
"path_to_clips": path_to_clips,
|
126 |
},
|
127 |
+
) for split in split_type
|
128 |
]
|
129 |
|
130 |
def _generate_examples(
|