Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support supergpqa #1924

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/eval_supergpqa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from mmengine import read_base

with read_base():
# from opencompass.configs.datasets.supergpqa.supergpqa_mixed_gen_d00bdd import \
# supergpqa_mixed_datasets as mixed_datasets
from opencompass.configs.datasets.supergpqa.supergpqa_single_0_shot_gen import \
supergpqa_0shot_single_datasets as zero_shot_datasets
# from opencompass.configs.datasets.supergpqa.supergpqa_single_3_shot_gen import \
# supergpqa_3shot_single_datasets as three_shot_datasets
from opencompass.configs.models.hf_internlm.hf_internlm2_5_7b import \
models as hf_internlm2_5_7b

datasets = zero_shot_datasets
models = hf_internlm2_5_7b
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from opencompass.datasets.supergpqa.supergpqa import SuperGPQADataset, SuperGPQAEvaluator
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever


supergpqa_0shot_single_datasets = []
prompt_template = dict(
type=PromptTemplate,
template=dict(
begin=[
dict(
role='HUMAN',
prompt=''
)
],
round=[
dict(
role='HUMAN',
prompt='{infer_prompt}' # f-string
)
]
)
)

# Reader configuration
reader_cfg = dict(
input_columns=['infer_prompt'],
output_column='answer_letter',
)

# Inference configuration
infer_cfg = dict(
prompt_template=prompt_template,
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer, max_out_len=1024),
)

# Evaluation configuration
eval_cfg = dict(
evaluator=dict(type=SuperGPQAEvaluator),
pred_role='BOT',
)
supergpqa_dataset = dict(
type=SuperGPQADataset,
abbr='supergpqa',
path='opencompass/supergpqa',
prompt_mode='zero-shot',
reader_cfg=reader_cfg,
infer_cfg=infer_cfg,
eval_cfg=eval_cfg,
)
# print(type(supergpqa_0shot_single_datasets))

supergpqa_0shot_single_datasets.append(supergpqa_dataset)
Loading