"official/legacy/xlnet/preprocess_utils.py" did not exist on "999fae620807dc9c7425ae814a1822836335d427"
infinitebench_mathfind_gen_6d799e.py 1.52 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import InfiniteBenchmathfindDataset
from opencompass.datasets.infinitebench.utils import InfiniteBench_first_number_postprocess

InfiniteBench_mathfind_reader_cfg = dict(
    input_columns=['prefix', 'context', 'question'],
    output_column='answer',
11

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
)

InfiniteBench_mathfind_infer_cfg = dict(
    prompt_template=dict(
        type=PromptTemplate,
        template=dict(
            begin=[
                dict(role='SYSTEM', fallback_role='HUMAN', prompt='You are a helpful assistant.'),
            ],
            round=[
                dict(role='HUMAN', prompt='{prefix}\n\n{context}\n\n{input}'),
                dict(role='BOT', prompt=''),
            ], )),
    retriever=dict(type=ZeroRetriever),
    inferencer=dict(type=GenInferencer, max_out_len=3)
)

InfiniteBench_mathfind_eval_cfg = dict(
    evaluator=dict(type=AccEvaluator),
    pred_postprocessor=dict(type=InfiniteBench_first_number_postprocess),
    pred_role='BOT'
)

InfiniteBench_mathfind_datasets = [
    dict(
        type=InfiniteBenchmathfindDataset,
        abbr='InfiniteBench_mathfind',
        path='./data/InfiniteBench/math_find.jsonl',
        reader_cfg=InfiniteBench_mathfind_reader_cfg,
        infer_cfg=InfiniteBench_mathfind_infer_cfg,
        eval_cfg=InfiniteBench_mathfind_eval_cfg)
]