Commit 29c1f228 authored by Leo Gao's avatar Leo Gao
Browse files

Fix typo

parent ec16d81d
......@@ -33,16 +33,16 @@ class HFTask(Task):
# If data is too large to fit in memory, override this method.
if self.has_training_docs():
if self._training_docs is None:
self._training_docs = list(map(self._convert_standard(self.data["train"]))
self._training_docs = list(map(self._convert_standard, self.data["train"]))
return self._training_docs
def validation_docs(self):
if self.has_validation_docs():
return map(self._convert_standard(self.data["validation"])
return map(self._convert_standard, self.data["validation"])
def test_docs(self):
if self.has_test_docs():
return map(self._convert_standard(self.data["test"])
return map(self._convert_standard, self.data["test"])
def yesno(x):
......
......@@ -29,21 +29,5 @@ class PiQA(HFTask, MultipleChoiceTask):
}
return out_doc
def _load_docs(self, docs):
for record in docs:
yield self._convert_standard(record)
def training_docs(self):
docs = super().training_docs()
return self._load_docs(docs)
def validation_docs(self):
docs = super().validation_docs()
return self._load_docs(docs)
def test_docs(self):
docs = super().test_docs()
return self._load_docs(docs)
def doc_to_text(self, doc):
return "Question: " + doc["goal"] + "\nAnswer:"
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