Loyage commited on
Commit
17a06a6
1 Parent(s): 7e13616

Update startimes_luganda_recording.py

Browse files
Files changed (1) hide show
  1. startimes_luganda_recording.py +9 -7
startimes_luganda_recording.py CHANGED
@@ -61,21 +61,23 @@ class StartimesLugandaRecording(datasets.GeneratorBasedBuilder):
61
  archive_paths = {}
62
  metadata_path = dl_manager.download_and_extract(f"{_DATA_URL}/metadata.tsv")
63
 
64
- audio_urls = {}
65
- audio_urls["train"] = []
66
  for speaker, dates in _DATASET_DICT.items():
 
 
67
  for date in dates:
68
  audio_urls["train"].append(f"{_DATA_URL}/{date}-{speaker}.tar")
69
- archive_paths = dl_manager.download(audio_urls)
70
- local_extracted_archive_paths = (
71
- dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
72
- )
 
73
 
74
  return [
75
  datasets.SplitGenerator(
76
  name=datasets.Split.TRAIN,
77
  gen_kwargs={
78
- "local_extracted_archive_paths": local_extracted_archive_paths.get(
79
  "train"
80
  ),
81
  "archives": [
 
61
  archive_paths = {}
62
  metadata_path = dl_manager.download_and_extract(f"{_DATA_URL}/metadata.tsv")
63
 
64
+ local_extracted_archive_paths_list = []
 
65
  for speaker, dates in _DATASET_DICT.items():
66
+ audio_urls = {}
67
+ audio_urls["train"] = []
68
  for date in dates:
69
  audio_urls["train"].append(f"{_DATA_URL}/{date}-{speaker}.tar")
70
+ archive_paths = dl_manager.download(audio_urls)
71
+ local_extracted_archive_paths = (
72
+ dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
73
+ )
74
+ local_extracted_archive_paths_list.append(local_extracted_archive_paths)
75
 
76
  return [
77
  datasets.SplitGenerator(
78
  name=datasets.Split.TRAIN,
79
  gen_kwargs={
80
+ "local_extracted_archive_paths": local_extracted_archive_paths[0].get(
81
  "train"
82
  ),
83
  "archives": [