mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
update
This commit is contained in:
parent
b3efc3f2df
commit
019c61e9f5
@ -8,7 +8,7 @@ from opencompass.registry import DICT_POSTPROCESSORS
|
|||||||
from .utils import get_judgeanswer_and_reference
|
from .utils import get_judgeanswer_and_reference
|
||||||
|
|
||||||
|
|
||||||
def post_process_mtbench(judgement: str):
|
def post_process(judgement: str):
|
||||||
"""Input a string like below:
|
"""Input a string like below:
|
||||||
|
|
||||||
xxx[[5]]xxx, and extract the score
|
xxx[[5]]xxx, and extract the score
|
||||||
@ -38,8 +38,6 @@ def get_capability_results(judged_answers, references):
|
|||||||
s = total_score / capability_counts[capability]
|
s = total_score / capability_counts[capability]
|
||||||
s = round(s, 2)
|
s = round(s, 2)
|
||||||
capability_avg_ratings[capability] = s
|
capability_avg_ratings[capability] = s
|
||||||
columns = list(capability_avg_ratings.keys())
|
|
||||||
columns.insert(0, columns.pop(columns.index('total')))
|
|
||||||
|
|
||||||
return capability_avg_ratings
|
return capability_avg_ratings
|
||||||
|
|
||||||
@ -48,7 +46,7 @@ def get_capability_results(judged_answers, references):
|
|||||||
def commonbench_postprocess(
|
def commonbench_postprocess(
|
||||||
output: dict,
|
output: dict,
|
||||||
output_path: str,
|
output_path: str,
|
||||||
post_process: Optional[callable] = post_process_mtbench,
|
post_process: Optional[callable] = post_process,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
judged_answers, references = get_judgeanswer_and_reference(
|
judged_answers, references = get_judgeanswer_and_reference(
|
||||||
output, output_path, post_process)
|
output, output_path, post_process)
|
||||||
|
Loading…
Reference in New Issue
Block a user