Datasets:
GEM
/

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
ratishsp commited on
Commit
1b33edd
1 Parent(s): 59359ce

download and extract urls separately

Browse files
Files changed (1) hide show
  1. mlb_data_to_text.py +6 -4
mlb_data_to_text.py CHANGED
@@ -222,13 +222,15 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
222
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
223
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
224
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
225
- data_dir = dl_manager.download_and_extract(_URLs)
 
 
226
  return [
227
  datasets.SplitGenerator(
228
  name=datasets.Split.TRAIN,
229
  # These kwargs will be passed to _generate_examples
230
  gen_kwargs={
231
- "filepath": data_dir["train"],
232
  "split": "train",
233
  },
234
  ),
@@ -236,7 +238,7 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
236
  name=datasets.Split.TEST,
237
  # These kwargs will be passed to _generate_examples
238
  gen_kwargs={
239
- "filepath": data_dir["test"],
240
  "split": "test"
241
  },
242
  ),
@@ -244,7 +246,7 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
244
  name=datasets.Split.VALIDATION,
245
  # These kwargs will be passed to _generate_examples
246
  gen_kwargs={
247
- "filepath": data_dir["validation"],
248
  "split": "validation",
249
  },
250
  ),
 
222
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
223
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
224
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
225
+ train_dir = dl_manager.download_and_extract(_URLs["train"])
226
+ validation_dir = dl_manager.download_and_extract(_URLs["validation"])
227
+ test_dir = dl_manager.download_and_extract(_URLs["test"])
228
  return [
229
  datasets.SplitGenerator(
230
  name=datasets.Split.TRAIN,
231
  # These kwargs will be passed to _generate_examples
232
  gen_kwargs={
233
+ "filepath": train_dir,
234
  "split": "train",
235
  },
236
  ),
 
238
  name=datasets.Split.TEST,
239
  # These kwargs will be passed to _generate_examples
240
  gen_kwargs={
241
+ "filepath": test_dir,
242
  "split": "test"
243
  },
244
  ),
 
246
  name=datasets.Split.VALIDATION,
247
  # These kwargs will be passed to _generate_examples
248
  gen_kwargs={
249
+ "filepath": validation_dir,
250
  "split": "validation",
251
  },
252
  ),