2024-08-01 00:42:48 +08:00
|
|
|
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 import LongBenchRougeEvaluator, LongBenchdureaderDataset
|
|
|
|
|
|
|
|
LongBench_dureader_reader_cfg = dict(
|
|
|
|
input_columns=['context', 'input'],
|
|
|
|
output_column='answers',
|
|
|
|
train_split='test',
|
2024-09-06 15:50:12 +08:00
|
|
|
test_split='test',
|
2024-08-01 00:42:48 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
LongBench_dureader_infer_cfg = dict(
|
|
|
|
prompt_template=dict(
|
|
|
|
type=PromptTemplate,
|
|
|
|
template=dict(
|
|
|
|
round=[
|
2024-09-06 15:50:12 +08:00
|
|
|
dict(
|
|
|
|
role='HUMAN',
|
|
|
|
prompt='请基于给定的文章回答下述问题。\n\n文章:{context}\n\n请基于上述文章回答下面的问题。\n\n问题:{input}\n回答:',
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2024-08-01 00:42:48 +08:00
|
|
|
retriever=dict(type=ZeroRetriever),
|
2024-09-06 15:50:12 +08:00
|
|
|
inferencer=dict(type=GenInferencer, max_out_len=128),
|
2024-08-01 00:42:48 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
LongBench_dureader_eval_cfg = dict(
|
2024-09-06 15:50:12 +08:00
|
|
|
evaluator=dict(type=LongBenchRougeEvaluator, language='zh'), pred_role='BOT'
|
2024-08-01 00:42:48 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
LongBench_dureader_datasets = [
|
|
|
|
dict(
|
|
|
|
type=LongBenchdureaderDataset,
|
|
|
|
abbr='LongBench_dureader',
|
2024-09-06 15:50:12 +08:00
|
|
|
path='opencompass/Longbench',
|
2024-08-01 00:42:48 +08:00
|
|
|
name='dureader',
|
|
|
|
reader_cfg=LongBench_dureader_reader_cfg,
|
|
|
|
infer_cfg=LongBench_dureader_infer_cfg,
|
2024-09-06 15:50:12 +08:00
|
|
|
eval_cfg=LongBench_dureader_eval_cfg,
|
|
|
|
)
|
2024-08-01 00:42:48 +08:00
|
|
|
]
|