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

51 lines
1.5 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():
2025-02-10 23:03:50 +08:00
from .HuMatchingFIB_setting import INSTRUCTIONS, DATA_PATH, DATA_VERSION
2025-02-10 23:03:50 +08:00
PROMPT_LANGUAGES = [
'en',
# 'hu',
]
2025-02-10 23:03:50 +08:00
HuMatchingFIB_reader_cfg = dict(
2025-02-02 13:05:39 +08:00
input_columns=['question', 'options', 'hu_specific_dim'],
output_column='reference')
2025-02-10 23:03:50 +08:00
HuMatchingFIB_datasets = []
for lang in PROMPT_LANGUAGES:
instruction = INSTRUCTIONS[lang]
HuMatchingFIB_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
begin='</E>',
round=[
dict(role='HUMAN', prompt=instruction),
],
),
ice_token='</E>',
2025-01-21 20:23:27 +08:00
),
2025-02-10 23:03:50 +08:00
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
HuMatchingFIB_eval_cfg = dict(evaluator=dict(type=HuMatchingFIBEvaluator))
HuMatchingFIB_datasets.append(
dict(
abbr=f'OpenHuEval_HuMatchingFIB_{DATA_VERSION}-prompt_{lang}',
type=HuMatchingFIBDataset,
filepath=DATA_PATH,
reader_cfg=HuMatchingFIB_reader_cfg,
infer_cfg=HuMatchingFIB_infer_cfg,
eval_cfg=HuMatchingFIB_eval_cfg,
))