-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Datasets] Add datasets CMO&AIME (#1610)
* add datasets cmo&aime * delete unused modules * modify prompt * update __init__ * update data load and add README * update data load * update performance * update md5 * remove indents * add indent * fix log for debug mode
- Loading branch information
Showing
11 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Description | ||
|
||
Math dataset composed of problems from AIME2024 (American Invitational Mathematics Examination 2024). | ||
|
||
### Performance | ||
|
||
| Qwen2.5-Math-72B-Instruct | Qwen2.5-Math-7B-Instruct | Qwen2-Math-7B-Instruct | Qwen2-Math-1.5B-Instruct | internlm2-math-7b | | ||
| ----------- | ----------- | ----------- | ----------- | ----------- | | ||
| 20.00 | 16.67 | 16.67 | 13.33 | 3.33 | | ||
|
||
| Qwen2.5-72B-Instruct | Qwen2.5-7B-Instruct | internlm2_5-7b-chat | | ||
| ----------- | ----------- | ----------- | | ||
| 31.25 | 26.44 | 9.13 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from mmengine.config import read_base | ||
|
||
with read_base(): | ||
from .aime2024_gen_6e39a4 import aime2024_datasets # noqa: F401, F403 |
39 changes: 39 additions & 0 deletions
39
opencompass/configs/datasets/aime2024/aime2024_gen_6e39a4.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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 Aime2024Dataset, MATHEvaluator, math_postprocess_v2 | ||
|
||
|
||
aime2024_reader_cfg = dict( | ||
input_columns=['question'], | ||
output_column='answer' | ||
) | ||
|
||
|
||
aime2024_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict( | ||
round=[ | ||
dict(role='HUMAN', prompt='{question}\nPlease reason step by step, and put your final answer within \\boxed{}.'), | ||
], | ||
) | ||
), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=GenInferencer, max_out_len=2048) | ||
) | ||
|
||
aime2024_eval_cfg = dict( | ||
evaluator=dict(type=MATHEvaluator, version='v2'), pred_postprocessor=dict(type=math_postprocess_v2) | ||
) | ||
|
||
aime2024_datasets = [ | ||
dict( | ||
abbr='aime2024', | ||
type=Aime2024Dataset, | ||
path='opencompass/aime2024', | ||
reader_cfg=aime2024_reader_cfg, | ||
infer_cfg=aime2024_infer_cfg, | ||
eval_cfg=aime2024_eval_cfg | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Description | ||
|
||
Math dataset composed of problems from CMO (Chinese Mathematical Olympiad) 2009-2022 . | ||
|
||
### Performance | ||
|
||
| Qwen2.5-Math-72B-Instruct | Qwen2.5-Math-7B-Instruct | Qwen2-Math-7B-Instruct | Qwen2-Math-1.5B-Instruct | internlm2-math-7b | | ||
| ----------- | ----------- | ----------- | ----------- | ----------- | | ||
| 46.15 | 42.79 | 31.73 | 23.56 | 3.37 | | ||
|
||
| Qwen2.5-72B-Instruct | Qwen2.5-7B-Instruct | internlm2_5-7b-chat | | ||
| ----------- | ----------- | ----------- | | ||
| 20.00 | 16.67 | 6.67 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from mmengine.config import read_base | ||
|
||
with read_base(): | ||
from .cmo_fib_gen_ace24b import cmo_fib_datasets # noqa: F401, F403 |
39 changes: 39 additions & 0 deletions
39
opencompass/configs/datasets/cmo_fib/cmo_fib_gen_ace24b.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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 CMOFibDataset, MATHEvaluator, math_postprocess_v2 | ||
|
||
|
||
cmo_fib_reader_cfg = dict( | ||
input_columns=['question'], | ||
output_column='answer' | ||
) | ||
|
||
|
||
cmo_fib_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict( | ||
round=[ | ||
dict(role='HUMAN', prompt='{question}\n请一步一步地推理,并将最终答案写入\\boxed{}.'), | ||
], | ||
) | ||
), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=GenInferencer, max_out_len=2048) | ||
) | ||
|
||
cmo_fib_eval_cfg = dict( | ||
evaluator=dict(type=MATHEvaluator, version='v2'), pred_postprocessor=dict(type=math_postprocess_v2) | ||
) | ||
|
||
cmo_fib_datasets = [ | ||
dict( | ||
abbr='cmo_fib', | ||
type=CMOFibDataset, | ||
path='opencompass/cmo_fib', | ||
reader_cfg=cmo_fib_reader_cfg, | ||
infer_cfg=cmo_fib_infer_cfg, | ||
eval_cfg=cmo_fib_eval_cfg | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import json | ||
|
||
from datasets import Dataset | ||
|
||
from opencompass.registry import LOAD_DATASET | ||
from opencompass.utils import get_data_path | ||
|
||
from .base import BaseDataset | ||
|
||
|
||
@LOAD_DATASET.register_module() | ||
class Aime2024Dataset(BaseDataset): | ||
|
||
@staticmethod | ||
def load(path): | ||
path = get_data_path(path) | ||
dataset = [] | ||
with open(path, 'r') as f: | ||
for line in f: | ||
line = json.loads(line) | ||
origin_prompt = line['origin_prompt'] | ||
line['question'] = origin_prompt[:] | ||
line['answer'] = line['gold_answer'] | ||
dataset.append(line) | ||
return Dataset.from_list(dataset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import json | ||
|
||
from datasets import Dataset | ||
|
||
from opencompass.registry import LOAD_DATASET | ||
from opencompass.utils import get_data_path | ||
|
||
from .base import BaseDataset | ||
|
||
|
||
@LOAD_DATASET.register_module() | ||
class CMOFibDataset(BaseDataset): | ||
|
||
@staticmethod | ||
def load(path): | ||
path = get_data_path(path) | ||
dataset = [] | ||
with open(path, 'r') as f: | ||
for line in f: | ||
line = json.loads(line) | ||
origin_prompt = line['origin_prompt'] | ||
line['question'] = origin_prompt[:] | ||
line['answer'] = line['gold_answer'] | ||
dataset.append(line) | ||
return Dataset.from_list(dataset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters