-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4970d1
commit da7b1c3
Showing
4 changed files
with
131 additions
and
147 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
108 changes: 54 additions & 54 deletions
108
configs/datasets/subjective/multiround/mtbench101_judge.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 |
---|---|---|
@@ -1,62 +1,62 @@ | ||
from opencompass.openicl.icl_prompt_template import PromptTemplate | ||
from opencompass.openicl.icl_retriever import ZeroRetriever | ||
from opencompass.openicl.icl_inferencer import ChatInferencer, GenInferencer | ||
from opencompass.openicl.icl_evaluator import LMEvaluator | ||
from opencompass.datasets import MTBench101Dataset | ||
from opencompass.openicl.icl_prompt_template import PromptTemplate | ||
from opencompass.openicl.icl_retriever import ZeroRetriever | ||
from opencompass.openicl.icl_inferencer import ChatInferencer, GenInferencer | ||
from opencompass.openicl.icl_evaluator import LMEvaluator | ||
from opencompass.datasets import MTBench101Dataset | ||
|
||
|
||
subjective_reader_cfg = dict( | ||
input_columns=["dialogue","task","multi_id","turn_id","system_prompt",'prompt_template'], | ||
output_column='judge', | ||
) | ||
|
||
subjective_all_sets = [ | ||
"mtbench101", | ||
] | ||
data_path ="data/subjective/" | ||
subjective_reader_cfg = dict( | ||
input_columns=['dialogue','task','multi_id','turn_id','system_prompt','prompt_template'], | ||
output_column='judge', | ||
) | ||
|
||
subjective_datasets = [] | ||
subjective_all_sets = [ | ||
'mtbench101', | ||
] | ||
data_path ='data/subjective/' | ||
|
||
for _name in subjective_all_sets: | ||
subjective_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template="""{dialogue}""", | ||
), | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=ChatInferencer, max_seq_len=4096, max_out_len=4096, infer_mode='last'), | ||
) | ||
subjective_datasets = [] | ||
|
||
subjective_eval_cfg = dict( | ||
evaluator=dict( | ||
type=LMEvaluator, | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict( | ||
begin=[ | ||
dict( | ||
role='SYSTEM', | ||
fallback_role='HUMAN', | ||
prompt="{system_prompt}") | ||
], | ||
round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt = "{prompt_template}" | ||
), | ||
]), | ||
), | ||
for _name in subjective_all_sets: | ||
subjective_infer_cfg = dict( | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template="""{dialogue}""", | ||
), | ||
pred_role="BOT", | ||
retriever=dict(type=ZeroRetriever), | ||
inferencer=dict(type=ChatInferencer, max_seq_len=4096, max_out_len=4096, infer_mode='last'), | ||
) | ||
|
||
subjective_datasets.append( | ||
dict( | ||
abbr=f"{_name}", | ||
type=MTBench101Dataset, | ||
path=data_path, | ||
name=_name, | ||
reader_cfg=subjective_reader_cfg, | ||
infer_cfg=subjective_infer_cfg, | ||
eval_cfg=subjective_eval_cfg | ||
)) | ||
subjective_eval_cfg = dict( | ||
evaluator=dict( | ||
type=LMEvaluator, | ||
prompt_template=dict( | ||
type=PromptTemplate, | ||
template=dict( | ||
begin=[ | ||
dict( | ||
role='SYSTEM', | ||
fallback_role='HUMAN', | ||
prompt='{system_prompt}') | ||
], | ||
round=[ | ||
dict( | ||
role='HUMAN', | ||
prompt = '{prompt_template}' | ||
), | ||
]), | ||
), | ||
), | ||
pred_role='BOT', | ||
) | ||
|
||
subjective_datasets.append( | ||
dict( | ||
abbr=f'{_name}', | ||
type=MTBench101Dataset, | ||
path=data_path, | ||
name=_name, | ||
reader_cfg=subjective_reader_cfg, | ||
infer_cfg=subjective_infer_cfg, | ||
eval_cfg=subjective_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
Oops, something went wrong.