forked from open-compass/opencompass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add gpqa prompt from simple_evals, openai (open-compass#1080)
* add gpqa_openai_simple_eval * 触发CI构建 * reorg --------- Co-authored-by: Leymore <[email protected]>
- Loading branch information
1 parent
f054e24
commit 980f704
Showing
3 changed files
with
106 additions
and
2 deletions.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from mmengine.config import read_base | ||
|
||
with read_base(): | ||
from .gpqa_gen_4baadb import gpqa_datasets | ||
from .gpqa_openai_simple_evals_gen_5aeece import gpqa_datasets |
52 changes: 52 additions & 0 deletions
52
configs/datasets/gpqa/gpqa_openai_simple_evals_gen_5aeece.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,52 @@ | ||
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 GPQADataset_Simple_Eval, GPQA_Simple_Eval_postprocess, GPQAEvaluator | ||
|
||
# openai_simple_eval prompt | ||
align_prompt = """ | ||
Answer the following multiple choice question. The last line of your response should be of the following format: 'ANSWER: $LETTER' (without quotes) where LETTER is one of ABCD. Think step by step before answering. | ||
{question} | ||
A) {A} | ||
B) {B} | ||
C) {C} | ||
D) {D} | ||
""".strip() | ||
|
||
gpqa_reader_cfg = dict( | ||
input_columns=['question', 'A', 'B', 'C', 'D'], | ||
output_column='answer') | ||
|
||
gpqa_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict( | ||
round=[ | ||
dict(role='HUMAN', prompt=align_prompt), | ||
], )), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=GenInferencer)) | ||
|
||
gpqa_eval_cfg = dict(evaluator=dict(type=GPQAEvaluator), | ||
pred_postprocessor=dict(type=GPQA_Simple_Eval_postprocess)) | ||
|
||
gpqa_datasets = [] | ||
gpqa_subsets = { | ||
# 'extended': 'gpqa_extended.csv', | ||
# 'main': 'gpqa_main.csv', | ||
'diamond': 'gpqa_diamond.csv' | ||
} | ||
|
||
for split in list(gpqa_subsets.keys()): | ||
gpqa_datasets.append( | ||
dict( | ||
abbr='GPQA_' + split, | ||
type=GPQADataset_Simple_Eval, | ||
path='./data/gpqa/', | ||
name=gpqa_subsets[split], | ||
reader_cfg=gpqa_reader_cfg, | ||
infer_cfg=gpqa_infer_cfg, | ||
eval_cfg=gpqa_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