MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / process_results

Method process_results

lm-eval-harness/lm_eval/api/task.py:1386–1399  ·  view source on GitHub ↗
(self, doc: dict, results: List[Tuple[float, bool]])

Source from the content-addressed store, hash-verified

1384 ]
1385
1386 def process_results(self, doc: dict, results: List[Tuple[float, bool]]) -> dict:
1387 results = [
1388 res[0] for res in results
1389 ] # only retain loglikelihoods, discard is_greedy TODO: do we need is_greedy anywhere?
1390 gold = doc["gold"]
1391
1392 acc = 1.0 if np.argmax(results) == gold else 0.0
1393 completion_len = np.array([float(len(i)) for i in doc["choices"]])
1394 acc_norm = 1.0 if np.argmax(results / completion_len) == gold else 0.0
1395
1396 return {
1397 "acc": acc,
1398 "acc_norm": acc_norm,
1399 }
1400
1401 def higher_is_better(self) -> dict:
1402 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected