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

Method process_results

test/general/lm_eval/tasks/babi.py:72–84  ·  view source on GitHub ↗

Take a single document and the LM results and evaluates, returning a dict where keys are the names of submetrics and values are the values of the metric for that one document :param doc: The document as returned from training_docs, validation_docs, or test_docs.

(self, doc, results)

Source from the content-addressed store, hash-verified

70 return rf.greedy_until(ctx, ["\n"])
71
72 def process_results(self, doc, results):
73 """Take a single document and the LM results and evaluates, returning a
74 dict where keys are the names of submetrics and values are the values of
75 the metric for that one document
76
77 :param doc:
78 The document as returned from training_docs, validation_docs, or test_docs.
79 :param results:
80 The results of the requests created in construct_requests.
81 """
82 gold = doc["answer"]
83 pred = gold.strip() == results[0].strip()
84 return {"em": pred}
85
86 def aggregation(self):
87 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected