mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
fix
This commit is contained in:
parent
dc8deb6af0
commit
d37527f54b
@ -1,15 +1,14 @@
|
|||||||
from opencompass.openicl.icl_prompt_template import PromptTemplate
|
from opencompass.openicl.icl_prompt_template import PromptTemplate
|
||||||
from opencompass.openicl.icl_retriever import ZeroRetriever
|
from opencompass.openicl.icl_retriever import ZeroRetriever
|
||||||
from opencompass.openicl.icl_inferencer import GenInferencer
|
from opencompass.openicl.icl_inferencer import GenInferencer
|
||||||
from opencompass.openicl.icl_evaluator import MATHEvaluator
|
|
||||||
from opencompass.datasets import (
|
from opencompass.datasets import (
|
||||||
MATHDataset,
|
MATHDataset,
|
||||||
|
MATHEvaluator,
|
||||||
math_postprocess_v2,
|
math_postprocess_v2,
|
||||||
normalize_final_answer,
|
normalize_final_answer,
|
||||||
)
|
)
|
||||||
|
|
||||||
math_reader_cfg = dict(input_columns=['problem'], output_column='solution')
|
math_reader_cfg = dict(input_columns=['problem'], output_column='solution')
|
||||||
|
|
||||||
math_infer_cfg = dict(
|
math_infer_cfg = dict(
|
||||||
prompt_template=dict(
|
prompt_template=dict(
|
||||||
type=PromptTemplate,
|
type=PromptTemplate,
|
||||||
@ -28,7 +27,8 @@ math_infer_cfg = dict(
|
|||||||
|
|
||||||
# postprocess v2
|
# postprocess v2
|
||||||
math_eval_cfg = dict(
|
math_eval_cfg = dict(
|
||||||
evaluator=dict(type=MATHEvaluator)
|
evaluator=dict(type=MATHEvaluator, version='v2'),
|
||||||
|
pred_postprocessor=dict(type=math_postprocess_v2),
|
||||||
)
|
)
|
||||||
|
|
||||||
math_datasets = [
|
math_datasets = [
|
||||||
@ -41,4 +41,4 @@ math_datasets = [
|
|||||||
infer_cfg=math_infer_cfg,
|
infer_cfg=math_infer_cfg,
|
||||||
eval_cfg=math_eval_cfg,
|
eval_cfg=math_eval_cfg,
|
||||||
)
|
)
|
||||||
]
|
]
|
@ -0,0 +1,44 @@
|
|||||||
|
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 MATHEvaluator
|
||||||
|
from opencompass.datasets import (
|
||||||
|
MATHDataset,
|
||||||
|
math_postprocess_v2,
|
||||||
|
normalize_final_answer,
|
||||||
|
)
|
||||||
|
|
||||||
|
math_reader_cfg = dict(input_columns=['problem'], output_column='solution')
|
||||||
|
|
||||||
|
math_infer_cfg = dict(
|
||||||
|
prompt_template=dict(
|
||||||
|
type=PromptTemplate,
|
||||||
|
template=dict(
|
||||||
|
round=[
|
||||||
|
dict(
|
||||||
|
role='HUMAN',
|
||||||
|
prompt='{problem}\nPlease reason step by step, and put your final answer within \\boxed{}.',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
),
|
||||||
|
retriever=dict(type=ZeroRetriever),
|
||||||
|
inferencer=dict(type=GenInferencer),
|
||||||
|
)
|
||||||
|
|
||||||
|
# postprocess v2
|
||||||
|
math_eval_cfg = dict(
|
||||||
|
evaluator=dict(type=MATHEvaluator)
|
||||||
|
)
|
||||||
|
|
||||||
|
math_datasets = [
|
||||||
|
dict(
|
||||||
|
type=MATHDataset,
|
||||||
|
abbr='math_prm800k_500',
|
||||||
|
path='opencompass/math',
|
||||||
|
file_name='test_prm800k_500.json',
|
||||||
|
reader_cfg=math_reader_cfg,
|
||||||
|
infer_cfg=math_infer_cfg,
|
||||||
|
eval_cfg=math_eval_cfg,
|
||||||
|
)
|
||||||
|
]
|
@ -1,4 +1,4 @@
|
|||||||
from mmengine.config import read_base
|
from mmengine.config import read_base
|
||||||
|
|
||||||
with read_base():
|
with read_base():
|
||||||
from .math_prm800k_500_0shot_cot_gen import math_datasets # noqa: F401, F403
|
from .math_prm800k_500_0shot_cot_gen_11c4b5 import math_datasets # noqa: F401, F403
|
Loading…
Reference in New Issue
Block a user