2025-05-29 13:56:33 +08:00
|
|
|
from opencompass.datasets import HealthBenchDataset, HealthBenchEvaluator
|
2025-05-23 15:26:21 +08:00
|
|
|
from opencompass.openicl.icl_inferencer import ChatInferencer
|
|
|
|
from opencompass.openicl.icl_prompt_template import PromptTemplate
|
2025-05-15 16:50:05 +08:00
|
|
|
from opencompass.openicl.icl_retriever import ZeroRetriever
|
|
|
|
|
|
|
|
|
|
|
|
# Reader configuration
|
|
|
|
reader_cfg = dict(
|
|
|
|
input_columns=[
|
2025-05-29 12:23:49 +08:00
|
|
|
'prompt_trans',
|
2025-05-15 16:50:05 +08:00
|
|
|
],
|
|
|
|
output_column='prompt_id', # useless
|
|
|
|
)
|
|
|
|
|
2025-05-29 13:56:33 +08:00
|
|
|
|
2025-05-15 16:50:05 +08:00
|
|
|
infer_cfg = dict(
|
|
|
|
prompt_template=dict(
|
2025-05-23 15:26:21 +08:00
|
|
|
type=PromptTemplate,
|
|
|
|
template=dict(
|
|
|
|
round=[
|
|
|
|
dict(
|
|
|
|
role='HUMAN',
|
2025-05-29 12:23:49 +08:00
|
|
|
prompt='{prompt_trans}', # prompt mode: zero-shot
|
2025-05-23 15:26:21 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2025-05-15 16:50:05 +08:00
|
|
|
),
|
|
|
|
retriever=dict(type=ZeroRetriever),
|
2025-05-23 15:26:21 +08:00
|
|
|
inferencer=dict(type=ChatInferencer),
|
2025-05-15 16:50:05 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Evaluation configuration
|
2025-05-29 12:23:49 +08:00
|
|
|
|
|
|
|
healthbench_dataset = dict(
|
2025-05-15 16:50:05 +08:00
|
|
|
type=HealthBenchDataset,
|
2025-05-29 12:23:49 +08:00
|
|
|
abbr='healthbench',
|
2025-05-15 16:50:05 +08:00
|
|
|
path='huihuixu/healthbench',
|
2025-05-29 12:23:49 +08:00
|
|
|
subset='',
|
2025-05-15 16:50:05 +08:00
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
2025-05-29 12:23:49 +08:00
|
|
|
eval_cfg=dict(
|
|
|
|
evaluator=dict(type=HealthBenchEvaluator, n_repeats=1, n_threads=1, subset_name=''),
|
|
|
|
pred_role='BOT',
|
|
|
|
),
|
2025-05-15 16:50:05 +08:00
|
|
|
)
|
|
|
|
healthbench_hard_dataset = dict(
|
|
|
|
type=HealthBenchDataset,
|
|
|
|
abbr='healthbench_hard',
|
|
|
|
path='huihuixu/healthbench',
|
|
|
|
subset='hard',
|
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
2025-05-29 12:23:49 +08:00
|
|
|
eval_cfg=dict(
|
|
|
|
evaluator=dict(type=HealthBenchEvaluator, n_repeats=1, n_threads=1, subset_name='hard'),
|
|
|
|
pred_role='BOT',
|
|
|
|
),
|
2025-05-15 16:50:05 +08:00
|
|
|
)
|
|
|
|
healthbench_consensus_dataset = dict(
|
|
|
|
type=HealthBenchDataset,
|
|
|
|
abbr='healthbench_consensus',
|
|
|
|
path='huihuixu/healthbench',
|
|
|
|
subset='consensus',
|
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
2025-05-29 12:23:49 +08:00
|
|
|
eval_cfg=dict(
|
|
|
|
evaluator=dict(type=HealthBenchEvaluator, n_repeats=1, n_threads=1, subset_name='consensus'),
|
|
|
|
pred_role='BOT',
|
|
|
|
),
|
2025-05-15 16:50:05 +08:00
|
|
|
)
|
2025-05-29 12:23:49 +08:00
|
|
|
# healthbench_meta_dataset = dict(
|
|
|
|
# type=HealthBenchDatasetMeta,
|
|
|
|
# abbr='healthbench_meta',
|
|
|
|
# path='huihuixu/healthbench',
|
|
|
|
# subset='meta',
|
|
|
|
# reader_cfg=reader_cfg,
|
|
|
|
# infer_cfg=infer_cfg,
|
|
|
|
# eval_cfg=dict(
|
|
|
|
# evaluator=dict(type=HealthBenchEvaluator, n_repeats=1, n_threads=1, subset_name=''),
|
|
|
|
# pred_role='BOT',
|
|
|
|
# ),
|
|
|
|
# )
|
2025-05-15 16:50:05 +08:00
|
|
|
|
2025-05-29 12:23:49 +08:00
|
|
|
healthbench_all_datasets = [healthbench_dataset, healthbench_hard_dataset, healthbench_consensus_dataset, ] # healthbench_meta_dataset ]
|