baber commited on
Commit
7d2c20d
1 Parent(s): befa200

Update testing.py

Browse files
Files changed (1) hide show
  1. testing.py +8 -8
testing.py CHANGED
@@ -57,7 +57,6 @@ _URLS = {
57
  },
58
  "logieval": {
59
  "train": "https://raw.githubusercontent.com/csitfun/LogiEval/main/Data/logiqa_ood.jsonl",
60
- "validation": None,
61
  "test": "https://raw.githubusercontent.com/csitfun/LogiEval/main/Data/logiqa.jsonl",
62
 
63
  }
@@ -161,11 +160,11 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
161
  urls = {
162
  "train": _urls["train"],
163
  "test": _urls["test"],
164
- "validation": _urls["validation"],
165
  }
 
 
166
  data_dir = dl_manager.download_and_extract(urls)
167
- return [
168
- datasets.SplitGenerator(
169
  name=datasets.Split.TRAIN,
170
  # These kwargs will be passed to _generate_examples
171
  gen_kwargs={
@@ -178,15 +177,17 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
178
  # These kwargs will be passed to _generate_examples
179
  gen_kwargs={"filepath": data_dir["test"], "split": "test"},
180
  ),
181
- datasets.SplitGenerator(
 
 
182
  name=datasets.Split.VALIDATION,
183
  # These kwargs will be passed to _generate_examples
184
  gen_kwargs={
185
  "filepath": data_dir["validation"],
186
  "split": "validation",
187
  },
188
- ),
189
- ]
190
 
191
  def _generate_examples(self, filepath, split):
192
  with open(filepath, encoding="utf-8") as f:
@@ -224,4 +225,3 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
224
  "question": data["question"].strip(),
225
  "options": [x.strip() for x in data["options"]],
226
  }
227
-
 
57
  },
58
  "logieval": {
59
  "train": "https://raw.githubusercontent.com/csitfun/LogiEval/main/Data/logiqa_ood.jsonl",
 
60
  "test": "https://raw.githubusercontent.com/csitfun/LogiEval/main/Data/logiqa.jsonl",
61
 
62
  }
 
160
  urls = {
161
  "train": _urls["train"],
162
  "test": _urls["test"],
 
163
  }
164
+ if "validation" in _urls:
165
+ urls["validation"] = _urls["validation"]
166
  data_dir = dl_manager.download_and_extract(urls)
167
+ splits = [datasets.SplitGenerator(
 
168
  name=datasets.Split.TRAIN,
169
  # These kwargs will be passed to _generate_examples
170
  gen_kwargs={
 
177
  # These kwargs will be passed to _generate_examples
178
  gen_kwargs={"filepath": data_dir["test"], "split": "test"},
179
  ),
180
+ ]
181
+ if "validation" in _urls:
182
+ splits.append(datasets.SplitGenerator(
183
  name=datasets.Split.VALIDATION,
184
  # These kwargs will be passed to _generate_examples
185
  gen_kwargs={
186
  "filepath": data_dir["validation"],
187
  "split": "validation",
188
  },
189
+ ))
190
+ return splits
191
 
192
  def _generate_examples(self, filepath, split):
193
  with open(filepath, encoding="utf-8") as f:
 
225
  "question": data["question"].strip(),
226
  "options": [x.strip() for x in data["options"]],
227
  }