MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / cal_cmmlu

Function cal_cmmlu

light-eval/src/eval_cmmlu.py:185–197  ·  view source on GitHub ↗
(res)

Source from the content-addressed store, hash-verified

183 return total_results
184
185def cal_cmmlu(res):
186 print("\n\n\n")
187 results = {}
188 res = {k.split("-")[-1]: float(v) for k, v in res.items()}
189 for k, v in TASK_NAME_MAPPING.items():
190 avg_acc = np.mean(list(map(lambda x: res[x], v)))
191 print("%s acc: %.4f " % (k, avg_acc))
192 results[k] = "%.4f" % avg_acc
193 avg_all_acc = np.mean(list(res.values()))
194 print("AVERAGE acc:%.4f " % avg_all_acc)
195 results ['AVERAGE'] = "%.4f" % avg_all_acc
196
197 return results
198
199def main(args):
200

Callers 1

mainFunction · 0.85

Calls 1

printFunction · 0.85

Tested by

no test coverage detected