OpenCompass/opencompass/configs/datasets/OpenHuEval/HuMatchingFIB/HuMatchingFIB.py

46 lines
1.4 KiB
Python
Raw Normal View History

2025-01-21 20:23:27 +08:00
from mmengine.config import read_base
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets.OpenHuEval.HuMatchingFIB import HuMatchingFIBDataset, HuMatchingFIBEvaluator
with read_base():
from .HuMatchingFIB_setting import INSTRUCTION, DATA_PATH, DATA_VERSION
instruction = INSTRUCTION['prompt_template']
prompt_version = INSTRUCTION['version']
hu_matching_fib_reader_cfg = dict(input_columns=['question', 'subject'],
output_column='reference')
hu_matching_fib_datasets = []
hu_matching_fib_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
begin='</E>',
round=[
dict(role='HUMAN', prompt=instruction),
],
2025-01-21 20:23:27 +08:00
),
ice_token='</E>',
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
hu_matching_fib_eval_cfg = dict(evaluator=dict(type=HuMatchingFIBEvaluator))
hu_matching_fib_datasets.append(
dict(
abbr=f'hu_matching_fib_{DATA_VERSION}-prompt_{prompt_version}',
type=HuMatchingFIBDataset,
filepath=DATA_PATH,
reader_cfg=hu_matching_fib_reader_cfg,
infer_cfg=hu_matching_fib_infer_cfg,
eval_cfg=hu_matching_fib_eval_cfg,
))