VictorSanh
commited on
Commit
·
a587173
1
Parent(s):
856a31b
fix data_dir dictionnary task_name
Browse files
P3.py
CHANGED
@@ -232,13 +232,14 @@ class P3(datasets.GeneratorBasedBuilder):
|
|
232 |
def _split_generators(self, dl_manager):
|
233 |
split_generators = []
|
234 |
data_dir = dl_manager.download_and_extract(_URLs)
|
|
|
235 |
if "train" in self.config.splits:
|
236 |
split_generators.append(
|
237 |
datasets.SplitGenerator(
|
238 |
name=datasets.Split.TRAIN,
|
239 |
gen_kwargs={
|
240 |
-
"features_file": data_dir["features_file"],
|
241 |
-
"tfrecord": data_dir["tfrecord"],
|
242 |
"split": "train",
|
243 |
}
|
244 |
)
|
@@ -248,8 +249,8 @@ class P3(datasets.GeneratorBasedBuilder):
|
|
248 |
datasets.SplitGenerator(
|
249 |
name=datasets.Split.VALIDATION,
|
250 |
gen_kwargs={
|
251 |
-
"features_file": data_dir["features_file"],
|
252 |
-
"tfrecord": data_dir["tfrecord"],
|
253 |
"split": "validation",
|
254 |
}
|
255 |
)
|
@@ -259,8 +260,8 @@ class P3(datasets.GeneratorBasedBuilder):
|
|
259 |
datasets.SplitGenerator(
|
260 |
name=datasets.Split.TEST,
|
261 |
gen_kwargs={
|
262 |
-
"features_file": data_dir["features_file"],
|
263 |
-
"tfrecord": data_dir["tfrecord"],
|
264 |
"split": "test",
|
265 |
}
|
266 |
)
|
@@ -272,8 +273,8 @@ class P3(datasets.GeneratorBasedBuilder):
|
|
272 |
datasets.SplitGenerator(
|
273 |
name=datasets.Split(special_split_name),
|
274 |
gen_kwargs={
|
275 |
-
"features_file": data_dir["features_file"],
|
276 |
-
"tfrecord": data_dir["tfrecord"],
|
277 |
"split": special_split_name,
|
278 |
}
|
279 |
)
|
|
|
232 |
def _split_generators(self, dl_manager):
|
233 |
split_generators = []
|
234 |
data_dir = dl_manager.download_and_extract(_URLs)
|
235 |
+
task_name = self.config.name
|
236 |
if "train" in self.config.splits:
|
237 |
split_generators.append(
|
238 |
datasets.SplitGenerator(
|
239 |
name=datasets.Split.TRAIN,
|
240 |
gen_kwargs={
|
241 |
+
"features_file": data_dir[task_name]["features_file"],
|
242 |
+
"tfrecord": data_dir[task_name]["tfrecord"],
|
243 |
"split": "train",
|
244 |
}
|
245 |
)
|
|
|
249 |
datasets.SplitGenerator(
|
250 |
name=datasets.Split.VALIDATION,
|
251 |
gen_kwargs={
|
252 |
+
"features_file": data_dir[task_name]["features_file"],
|
253 |
+
"tfrecord": data_dir[task_name]["tfrecord"],
|
254 |
"split": "validation",
|
255 |
}
|
256 |
)
|
|
|
260 |
datasets.SplitGenerator(
|
261 |
name=datasets.Split.TEST,
|
262 |
gen_kwargs={
|
263 |
+
"features_file": data_dir[task_name]["features_file"],
|
264 |
+
"tfrecord": data_dir[task_name]["tfrecord"],
|
265 |
"split": "test",
|
266 |
}
|
267 |
)
|
|
|
273 |
datasets.SplitGenerator(
|
274 |
name=datasets.Split(special_split_name),
|
275 |
gen_kwargs={
|
276 |
+
"features_file": data_dir[task_name]["features_file"],
|
277 |
+
"tfrecord": data_dir[task_name]["tfrecord"],
|
278 |
"split": special_split_name,
|
279 |
}
|
280 |
)
|