cahya commited on
Commit
b2cb7cb
1 Parent(s): e82d6b8

restructured the splits

Browse files
Files changed (1) hide show
  1. 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
- splits = { "train": datasets.Split.TRAIN, "test": datasets.Split.TEST}
112
- for split in splits:
113
- audio[split] = dl_manager.download(f"{_DATA_URL}/audio_train.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=splits[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 splits
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(