2025-05-15 16:50:05 +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-23 15:26:21 +08:00
|
|
|
'prompt_trans'
|
2025-05-15 16:50:05 +08:00
|
|
|
],
|
|
|
|
output_column='prompt_id', # useless
|
|
|
|
)
|
|
|
|
|
|
|
|
infer_cfg = dict(
|
|
|
|
prompt_template=dict(
|
2025-05-23 15:26:21 +08:00
|
|
|
type=PromptTemplate,
|
|
|
|
template=dict(
|
|
|
|
round=[
|
|
|
|
dict(
|
|
|
|
role='HUMAN',
|
|
|
|
prompt='{prompt}', # prompt mode: zero-shot
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
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
|
|
|
|
eval_cfg = dict(
|
|
|
|
evaluator=dict(type=HealthBenchEvaluator),
|
|
|
|
pred_role='BOT',
|
|
|
|
)
|
|
|
|
healthbench_vanilla_dataset = dict(
|
|
|
|
type=HealthBenchDataset,
|
|
|
|
abbr='healthbench_vanilla',
|
|
|
|
path='huihuixu/healthbench',
|
|
|
|
subset='vanilla',
|
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
|
|
|
eval_cfg=eval_cfg,
|
|
|
|
)
|
|
|
|
healthbench_hard_dataset = dict(
|
|
|
|
type=HealthBenchDataset,
|
|
|
|
abbr='healthbench_hard',
|
|
|
|
path='huihuixu/healthbench',
|
|
|
|
subset='hard',
|
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
|
|
|
eval_cfg=eval_cfg,
|
|
|
|
)
|
|
|
|
healthbench_consensus_dataset = dict(
|
|
|
|
type=HealthBenchDataset,
|
|
|
|
abbr='healthbench_consensus',
|
|
|
|
path='huihuixu/healthbench',
|
|
|
|
subset='consensus',
|
|
|
|
reader_cfg=reader_cfg,
|
|
|
|
infer_cfg=infer_cfg,
|
|
|
|
eval_cfg=eval_cfg,
|
|
|
|
)
|
|
|
|
|
|
|
|
healthbench_all_datasets = [healthbench_vanilla_dataset, healthbench_hard_dataset, healthbench_consensus_dataset ]
|