Skip to content

Commit

Permalink
Refactor mmbench_aggregate_dev_results_eval function to generate and …
Browse files Browse the repository at this point in the history
…save detailed evaluation results
  • Loading branch information
Bo Li committed Apr 4, 2024
1 parent 22a4958 commit 8157676
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lmms_eval/tasks/mmbench/cn_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ def mmbench_process_results(doc, results):

def mmbench_aggregate_dev_results_eval(results, args):
print(f"============= MMBench-CN(Dev) Detailed Results =============")
accuracy = mmbench_evaluator.eval_result(results, eval_method="openai")
return accuracy * 100
overall_acc, category_acc, l2_category_acc = mmbench_evaluator.eval_result(results, eval_method="openai")
file = generate_submission_file("mmbench_cn_dev_results.json", args)
details_info = {
"overall_acc": overall_acc,
"category_acc": category_acc,
"l2_category_acc": l2_category_acc,
}
with open(file, "w") as f:
json.dump(details_info, f)
return overall_acc * 100


def mmbench_aggregate_dev_results(results, args):
Expand Down

0 comments on commit 8157676

Please sign in to comment.