Datasets:
mb23
/

Languages:
English
License:
mickylan2367 commited on
Commit
a80cf63
·
1 Parent(s): 5b3e9cb

Update LoadingScript

Browse files
Files changed (1) hide show
  1. GraySpectrogram.py +8 -7
GraySpectrogram.py CHANGED
@@ -195,22 +195,23 @@ class GraySpectrogram(datasets.GeneratorBasedBuilder):
195
 
196
  def _split_generators(self, dl_manager: DownloadManager):
197
 
198
- metadata_paths = dl_manager.download(self.config.metadata_url)
199
- data_paths = dl_manager.download(self.config.data_url)
200
-
 
201
  return [
202
  datasets.SplitGenerator(
203
  name=datasets.Split.TRAIN,
204
  gen_kwargs={
205
- "images": dl_manager.iter_archive(data_paths["train"]),
206
- "metadata_path": metadata_paths["train"],
207
  }
208
  ),
209
  datasets.SplitGenerator(
210
  name=datasets.Split.TEST,
211
  gen_kwargs={
212
- "images": dl_manager.iter_archive(data_paths["test"]),
213
- "metadata_path": metadata_paths["test"],
214
  }
215
  ),
216
  ]
 
195
 
196
  def _split_generators(self, dl_manager: DownloadManager):
197
 
198
+ train_metadata_path = dl_manager.download_and_extract(self.config.metadata_url["train"])
199
+ test_metadata_path = dl_manager.download_and_extract(self.config.metadata_url["test"])
200
+ train_data_path = dl_manager.download(self.config.data_url["train"])
201
+ test_data_path = dl_manager.download(self.config.data_url["test"])
202
  return [
203
  datasets.SplitGenerator(
204
  name=datasets.Split.TRAIN,
205
  gen_kwargs={
206
+ "images": dl_manager.iter_archive(train_data_path),
207
+ "metadata_path": train_metadata_path,
208
  }
209
  ),
210
  datasets.SplitGenerator(
211
  name=datasets.Split.TEST,
212
  gen_kwargs={
213
+ "images": dl_manager.iter_archive(test_data_path),
214
+ "metadata_path": test_metadata_path,
215
  }
216
  ),
217
  ]