MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / _process_doc

Method _process_doc

test/general/lm_eval/tasks/mathqa.py:52–64  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

50 return map(self._process_doc, self.dataset["test"])
51
52 def _process_doc(self, doc):
53 answer_idx = ["a", "b", "c", "d", "e"].index(doc["correct"])
54 choices = [
55 c[4:].rstrip(" ,")
56 for c in re.findall(r"[abcd] \) .*?, |e \) .*?$", doc["options"])
57 ]
58
59 out_doc = {
60 "query": "Question: " + doc["Problem"] + "\nAnswer:",
61 "choices": choices,
62 "gold": answer_idx,
63 }
64 return out_doc
65
66 def doc_to_text(self, doc):
67 return doc["query"]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected