apps_gen_c7893a.py 1.05 KB
Newer Older
Connor-Shen's avatar
Connor-Shen committed
1
2
3
4
5
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 APPSDataset, APPSEvaluator

6
APPS_reader_cfg = dict(input_columns=['question', 'starter'], output_column='problem_id', train_split='test')
Connor-Shen's avatar
Connor-Shen committed
7
8
9
10

APPS_infer_cfg = dict(
    prompt_template=dict(
        type=PromptTemplate,
11
        template='Please write a python program to address the following QUESTION. Your ANSWER should be in a code block format like this: ```python # Write your code here ```. \nQUESTION:\n{question} {starter}\nANSWER:\n'),
Connor-Shen's avatar
Connor-Shen committed
12
13
14
15
    retriever=dict(type=ZeroRetriever),
    inferencer=dict(type=GenInferencer, max_out_len=512),
)

16
APPS_eval_cfg = dict(evaluator=dict(type=APPSEvaluator), pred_role='BOT')
Connor-Shen's avatar
Connor-Shen committed
17
18
19
20

APPS_datasets = [
    dict(
        type=APPSDataset,
21
22
        abbr='apps',
        path='codeparrot/apps',
Connor-Shen's avatar
Connor-Shen committed
23
24
25
26
27
28
        num_repeats=1,
        reader_cfg=APPS_reader_cfg,
        infer_cfg=APPS_infer_cfg,
        eval_cfg=APPS_eval_cfg,
    )
]