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 support for internal Followbench (open-compass#1511)
* fix pip version * fix pip version * add internal followbench * add internal followbench * fix lint * fix lint
- Loading branch information
1 parent
3177633
commit 7c7fa36
Showing
9 changed files
with
560 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
63 changes: 63 additions & 0 deletions
63
configs/datasets/subjective/followbench/followbench_llmeval.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,63 @@ | ||
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 LMEvaluator | ||
from opencompass.datasets import FollowBenchDataset | ||
from opencompass.summarizers import FollowBenchSummarizer | ||
|
||
subjective_reader_cfg = dict( | ||
input_columns=['instruction', 'judge_prompt',], | ||
output_column='judge', | ||
) | ||
|
||
subjective_all_sets = [ | ||
'followbench_llmeval_cn', 'followbench_llmeval_en', | ||
] | ||
data_path ='data/subjective/followbench/converted_data' | ||
|
||
followbench_llmeval_dataset = [] | ||
|
||
for _name in subjective_all_sets: | ||
subjective_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict(round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt='{instruction}' | ||
), | ||
]), | ||
), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=GenInferencer, max_out_len=2048), | ||
) | ||
|
||
subjective_eval_cfg = dict( | ||
evaluator=dict( | ||
type=LMEvaluator, | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict(round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt = '{judge_prompt}' | ||
), | ||
]), | ||
), | ||
), | ||
pred_role='BOT', | ||
) | ||
|
||
followbench_llmeval_dataset.append( | ||
dict( | ||
abbr=f'{_name}', | ||
type=FollowBenchDataset, | ||
path=data_path, | ||
name=_name, | ||
mode='singlescore', | ||
cate='llm', | ||
reader_cfg=subjective_reader_cfg, | ||
infer_cfg=subjective_infer_cfg, | ||
eval_cfg=subjective_eval_cfg, | ||
summarizer = dict(type=FollowBenchSummarizer,) | ||
)) |
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
63 changes: 63 additions & 0 deletions
63
opencompass/configs/datasets/subjective/followbench/followbench_llmeval.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,63 @@ | ||
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 LMEvaluator | ||
from opencompass.datasets import FollowBenchDataset | ||
from opencompass.summarizers import FollowBenchSummarizer | ||
|
||
subjective_reader_cfg = dict( | ||
input_columns=['instruction', 'judge_prompt',], | ||
output_column='judge', | ||
) | ||
|
||
subjective_all_sets = [ | ||
'followbench_llmeval_cn', 'followbench_llmeval_en', | ||
] | ||
data_path ='data/subjective/followbench/converted_data' | ||
|
||
followbench_llmeval_dataset = [] | ||
|
||
for _name in subjective_all_sets: | ||
subjective_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict(round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt='{instruction}' | ||
), | ||
]), | ||
), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=GenInferencer, max_out_len=2048), | ||
) | ||
|
||
subjective_eval_cfg = dict( | ||
evaluator=dict( | ||
type=LMEvaluator, | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict(round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt = '{judge_prompt}' | ||
), | ||
]), | ||
), | ||
), | ||
pred_role='BOT', | ||
) | ||
|
||
followbench_llmeval_dataset.append( | ||
dict( | ||
abbr=f'{_name}', | ||
type=FollowBenchDataset, | ||
path=data_path, | ||
name=_name, | ||
mode='singlescore', | ||
cate='llm', | ||
reader_cfg=subjective_reader_cfg, | ||
infer_cfg=subjective_infer_cfg, | ||
eval_cfg=subjective_eval_cfg, | ||
summarizer = dict(type=FollowBenchSummarizer,) | ||
)) |
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
Oops, something went wrong.