Commit d22ea1f3 authored by Jonathan Tow's avatar Jonathan Tow
Browse files

Add `answer` key to training docs for uniformity

parent 410ca65f
...@@ -38,23 +38,22 @@ class Math(Task): ...@@ -38,23 +38,22 @@ class Math(Task):
def has_test_docs(self): def has_test_docs(self):
return True return True
def training_docs(self): def _load_docs(self, path):
path = self.DATASET_PATH / "train" / self.get_file_info()
for file in path.iterdir(): for file in path.iterdir():
with open(file) as f: with open(file) as f:
yield json.load(f) doc = json.load(f)
doc["answer"] = self.remove_boxed(
self.last_boxed_only_string(doc["solution"]))
yield doc
def training_docs(self):
return self._load_docs(self.DATASET_PATH / "train" / self.get_file_info())
def validation_docs(self): def validation_docs(self):
return NotImplemented return NotImplemented
def test_docs(self): def test_docs(self):
path = self.DATASET_PATH / "test" / self.get_file_info() return self._load_docs(self.DATASET_PATH / "test" / self.get_file_info())
for file in path.iterdir():
with open(file) as f:
doc = json.load(f)
doc["answer"] = self.remove_boxed(
self.last_boxed_only_string(doc["solution"]))
yield doc
def fewshot_description(self): def fewshot_description(self):
return "Given a mathematics problem, determine the answer. Simplify your answer as much as possible." return "Given a mathematics problem, determine the answer. Simplify your answer as much as possible."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment