2024-03-19 15:39:16 +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 TACODataset , TACOEvaluator
2024-05-14 15:35:58 +08:00
TACO_reader_cfg = dict ( input_columns = [ ' question ' , ' starter ' ] , output_column = ' problem_id ' , train_split = ' test ' )
2024-03-19 15:39:16 +08:00
TACO_infer_cfg = dict (
prompt_template = dict (
type = PromptTemplate ,
2024-05-14 15:35:58 +08:00
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 ```. \n QUESTION: \n {question} {starter} \n ANSWER: \n ' ) ,
2024-03-19 15:39:16 +08:00
retriever = dict ( type = ZeroRetriever ) ,
inferencer = dict ( type = GenInferencer , max_out_len = 512 ) ,
)
2024-05-14 15:35:58 +08:00
TACO_eval_cfg = dict ( evaluator = dict ( type = TACOEvaluator ) , pred_role = ' BOT ' )
2024-03-19 15:39:16 +08:00
TACO_datasets = [
dict (
type = TACODataset ,
2024-05-14 15:35:58 +08:00
abbr = ' TACO ' ,
2024-04-09 17:50:23 +08:00
path = ' ./data/BAAI-TACO ' ,
2024-03-19 15:39:16 +08:00
num_repeats = 1 ,
reader_cfg = TACO_reader_cfg ,
infer_cfg = TACO_infer_cfg ,
eval_cfg = TACO_eval_cfg ,
)
]