Skip to content

Commit

Permalink
[Feat] Support dataset_suffix check for mixed configs (#973)
Browse files Browse the repository at this point in the history
* [Feat] Support dataset_suffix check for mixed configs

* update mixed suffix

* update suffix

---------

Co-authored-by: Leymore <zfz-960727@163.com>
  • Loading branch information
xu-song and Leymore committed May 14, 2024
1 parent 7505b3c commit 3dbba11
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 229 deletions.
2 changes: 1 addition & 1 deletion configs/datasets/GaokaoBench/GaokaoBench_mixed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mmengine.config import read_base

with read_base():
from .GaokaoBench_mixed_f2038e import GaokaoBench_datasets # noqa: F401, F403
from .GaokaoBench_mixed_9af5ee import GaokaoBench_datasets # noqa: F401, F403
7 changes: 7 additions & 0 deletions configs/datasets/agieval/agieval_mixed_0fa998.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
_hint = '答案是:'
else:
_hint = 'The answer is '
agieval_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template={
label: dict(round=[
dict(role='HUMAN', prompt='{question}\n{options}'),
dict(role='BOT', prompt=f'{_hint}{label}')
])
for label in _options
}),
Expand Down
218 changes: 0 additions & 218 deletions configs/datasets/agieval/agieval_mixed_2f14ad.py

This file was deleted.

4 changes: 2 additions & 2 deletions configs/datasets/collections/base_medium.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
with read_base():
from ..mmlu.mmlu_ppl_ac766d import mmlu_datasets
from ..ceval.ceval_ppl_578f8d import ceval_datasets
from ..agieval.agieval_mixed_2f14ad import agieval_datasets
from ..GaokaoBench.GaokaoBench_mixed_f2038e import GaokaoBench_datasets
from ..agieval.agieval_mixed_713d14 import agieval_datasets
from ..GaokaoBench.GaokaoBench_mixed_9af5ee import GaokaoBench_datasets
from ..bbh.bbh_gen_5b92b0 import bbh_datasets
from ..humaneval.humaneval_gen_8e312c import humaneval_datasets
from ..mbpp.deprecated_mbpp_gen_1e1056 import mbpp_datasets
Expand Down
4 changes: 2 additions & 2 deletions configs/datasets/collections/base_medium_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
with read_base():
from ..mmlu.mmlu_ppl_ac766d import mmlu_datasets
from ..ceval.ceval_ppl_578f8d import ceval_datasets
from ..agieval.agieval_mixed_2f14ad import agieval_datasets
from ..GaokaoBench.GaokaoBench_mixed_f2038e import GaokaoBench_datasets
from ..agieval.agieval_mixed_713d14 import agieval_datasets
from ..GaokaoBench.GaokaoBench_mixed_9af5ee import GaokaoBench_datasets
from ..bbh.bbh_gen_5b92b0 import bbh_datasets
from ..humaneval.humaneval_gen_a82cae import humaneval_datasets
from ..mbpp.deprecated_mbpp_gen_1e1056 import mbpp_datasets
Expand Down
4 changes: 2 additions & 2 deletions configs/datasets/collections/leaderboard/qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

with read_base():
from ...ceval.ceval_ppl_578f8d import ceval_datasets
from ...agieval.agieval_mixed_2f14ad import agieval_datasets
from ...agieval.agieval_mixed_713d14 import agieval_datasets
from ...mmlu.mmlu_ppl_ac766d import mmlu_datasets
from ...cmmlu.cmmlu_ppl_8b9c76 import cmmlu_datasets
from ...GaokaoBench.GaokaoBench_mixed_f2038e import GaokaoBench_datasets
from ...GaokaoBench.GaokaoBench_mixed_9af5ee import GaokaoBench_datasets
from ...ARC_c.ARC_c_gen_1e0de5 import ARC_c_datasets
from ...ARC_e.ARC_e_gen_1e0de5 import ARC_e_datasets

Expand Down
2 changes: 1 addition & 1 deletion configs/datasets/collections/leaderboard/qwen_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

with read_base():
from ...ceval.ceval_gen_5f30c7 import ceval_datasets
from ...agieval.agieval_mixed_2f14ad import agieval_datasets
from ...agieval.agieval_mixed_713d14 import agieval_datasets
from ...mmlu.mmlu_gen_4d595a import mmlu_datasets
from ...cmmlu.cmmlu_gen_c13365 import cmmlu_datasets
from ...GaokaoBench.GaokaoBench_gen_5cfe9e import GaokaoBench_datasets
Expand Down
2 changes: 1 addition & 1 deletion configs/eval_hf_llama2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .datasets.nq.nq_open_gen_e93f8a import nq_datasets
from .datasets.gsm8k.gsm8k_gen_3309bd import gsm8k_datasets
from .datasets.humaneval.humaneval_gen_a82cae import humaneval_datasets
from .datasets.agieval.agieval_mixed_2f14ad import agieval_datasets
from .datasets.agieval.agieval_mixed_713d14 import agieval_datasets
from .datasets.SuperGLUE_BoolQ.SuperGLUE_BoolQ_ppl_314797 import BoolQ_datasets
from .datasets.hellaswag.hellaswag_ppl_a6e128 import hellaswag_datasets
from .datasets.obqa.obqa_ppl_6aac9e import obqa_datasets
Expand Down
2 changes: 1 addition & 1 deletion configs/eval_internlm2_keyset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

with read_base():
from .datasets.mmlu.mmlu_ppl_ac766d import mmlu_datasets
from .datasets.agieval.agieval_mixed_2f14ad import agieval_datasets
from .datasets.agieval.agieval_mixed_713d14 import agieval_datasets
from .datasets.bbh.bbh_gen_5b92b0 import bbh_datasets
from .datasets.gsm8k.gsm8k_gen_1d7fe4 import gsm8k_datasets
from .datasets.math.math_gen_265cce import math_datasets
Expand Down
2 changes: 1 addition & 1 deletion tools/update_dataset_suffix.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_hash(path):

def check_and_rename(filepath):
base_name = os.path.basename(filepath)
match = re.match(r'(.*)_(gen|ppl|ll)_(.*).py', base_name)
match = re.match(r'(.*)_(gen|ppl|ll|mixed)_(.*).py', base_name)
if match:
dataset, mode, old_hash = match.groups()
new_hash = get_hash(filepath)
Expand Down

0 comments on commit 3dbba11

Please sign in to comment.