2024-12-31 11:01:23 +08:00
|
|
|
from mmengine.config import read_base
|
|
|
|
|
|
|
|
with read_base():
|
|
|
|
from opencompass.configs.datasets.subjective.alpaca_eval.alpacav2_judgeby_gpt4_bradleyterry import (
|
2025-01-20 19:17:38 +08:00
|
|
|
alpacav2_datasets, )
|
2025-01-03 16:33:43 +08:00
|
|
|
|
|
|
|
from opencompass.configs.datasets.subjective.arena_hard.arena_hard_compare_bradleyterry import (
|
2025-01-20 19:17:38 +08:00
|
|
|
arenahard_datasets, )
|
2025-01-03 16:33:43 +08:00
|
|
|
|
2024-12-31 11:01:23 +08:00
|
|
|
from opencompass.configs.datasets.subjective.compassarena.compassarena_compare_bradleyterry import (
|
2025-01-20 19:17:38 +08:00
|
|
|
compassarena_datasets, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.datasets.subjective.wildbench.wildbench_pair_judge_bradleyterry import (
|
2025-01-20 19:17:38 +08:00
|
|
|
wildbench_datasets, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.models.hf_internlm.lmdeploy_internlm2_5_7b_chat import (
|
2025-01-20 19:17:38 +08:00
|
|
|
models as lmdeploy_internlm2_5_7b_chat, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.models.hf_internlm.lmdeploy_internlm2_5_20b_chat import (
|
2025-01-20 19:17:38 +08:00
|
|
|
models as lmdeploy_internlm2_5_20b_chat, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.models.qwen2_5.lmdeploy_qwen2_5_7b_instruct import (
|
2025-01-20 19:17:38 +08:00
|
|
|
models as lmdeploy_qwen2_5_7b_instruct, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.models.qwen2_5.lmdeploy_qwen2_5_14b_instruct import (
|
2025-01-20 19:17:38 +08:00
|
|
|
models as lmdeploy_qwen2_5_14b_instruct, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
from opencompass.configs.models.qwen.lmdeploy_qwen2_7b_instruct import (
|
2025-01-20 19:17:38 +08:00
|
|
|
models as lmdeploy_qwen2_7b_instruct, )
|
2024-12-31 11:01:23 +08:00
|
|
|
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.models import (HuggingFace, HuggingFaceCausalLM,
|
|
|
|
HuggingFaceChatGLM3, OpenAI,
|
|
|
|
TurboMindModelwithChatTemplate)
|
2024-12-31 11:01:23 +08:00
|
|
|
from opencompass.partitioners import NaivePartitioner, SizePartitioner
|
|
|
|
from opencompass.partitioners.sub_naive import SubjectiveNaivePartitioner
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.partitioners.sub_num_worker import \
|
|
|
|
SubjectiveNumWorkerPartitioner
|
2024-12-31 11:01:23 +08:00
|
|
|
from opencompass.partitioners.sub_size import SubjectiveSizePartitioner
|
|
|
|
from opencompass.runners import LocalRunner, SlurmSequentialRunner
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.summarizers import (CompassArenaBradleyTerrySummarizer,
|
|
|
|
SubjectiveSummarizer)
|
2024-12-31 11:01:23 +08:00
|
|
|
from opencompass.tasks import OpenICLInferTask
|
|
|
|
from opencompass.tasks.subjective_eval import SubjectiveEvalTask
|
|
|
|
|
2025-01-20 19:17:38 +08:00
|
|
|
api_meta_template = dict(round=[
|
|
|
|
dict(role='HUMAN', api_role='HUMAN'),
|
|
|
|
dict(role='BOT', api_role='BOT', generate=True),
|
|
|
|
])
|
2024-12-31 11:01:23 +08:00
|
|
|
|
|
|
|
# -------------Inference Stage ----------------------------------------
|
|
|
|
# For subjective evaluation, we often set do sample for models
|
|
|
|
models = [
|
|
|
|
*lmdeploy_internlm2_5_7b_chat,
|
|
|
|
*lmdeploy_internlm2_5_20b_chat,
|
|
|
|
*lmdeploy_qwen2_5_14b_instruct,
|
|
|
|
*lmdeploy_qwen2_5_7b_instruct,
|
|
|
|
*lmdeploy_qwen2_7b_instruct,
|
|
|
|
]
|
|
|
|
|
|
|
|
datasets = [
|
|
|
|
*alpacav2_datasets,
|
2025-01-03 16:33:43 +08:00
|
|
|
*arenahard_datasets,
|
2024-12-31 11:01:23 +08:00
|
|
|
*compassarena_datasets,
|
|
|
|
*wildbench_datasets,
|
|
|
|
]
|
|
|
|
|
|
|
|
infer = dict(
|
|
|
|
partitioner=dict(type=NaivePartitioner),
|
2025-01-20 19:17:38 +08:00
|
|
|
runner=dict(type=LocalRunner,
|
|
|
|
max_num_workers=16,
|
|
|
|
task=dict(type=OpenICLInferTask)),
|
2024-12-31 11:01:23 +08:00
|
|
|
)
|
|
|
|
# -------------Evalation Stage ----------------------------------------
|
|
|
|
|
|
|
|
## ------------- JudgeLLM Configuration
|
|
|
|
judge_models = [
|
|
|
|
dict(
|
|
|
|
type=TurboMindModelwithChatTemplate,
|
|
|
|
abbr='CompassJudger-1-32B-Instruct',
|
|
|
|
path='opencompass/CompassJudger-1-32B-Instruct',
|
|
|
|
engine_config=dict(session_len=16384, max_batch_size=16, tp=4),
|
2025-01-20 19:17:38 +08:00
|
|
|
gen_config=dict(top_k=1,
|
|
|
|
temperature=1e-6,
|
|
|
|
top_p=0.9,
|
|
|
|
max_new_tokens=2048),
|
2024-12-31 11:01:23 +08:00
|
|
|
max_seq_len=16384,
|
|
|
|
max_out_len=2048,
|
|
|
|
batch_size=16,
|
|
|
|
run_cfg=dict(num_gpus=4),
|
|
|
|
)
|
|
|
|
]
|
|
|
|
|
|
|
|
## ------------- Evaluation Configuration
|
|
|
|
eval = dict(
|
|
|
|
partitioner=dict(
|
|
|
|
type=SubjectiveNaivePartitioner,
|
|
|
|
models=models,
|
|
|
|
judge_models=judge_models,
|
|
|
|
),
|
2025-01-20 19:17:38 +08:00
|
|
|
runner=dict(type=LocalRunner,
|
|
|
|
max_num_workers=16,
|
|
|
|
task=dict(type=SubjectiveEvalTask)),
|
2024-12-31 11:01:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
## ------------- Summary Configuration
|
|
|
|
# This step fits a Bradley-Terry model (statistical model) with an option
|
|
|
|
# to include style features and control variables based on groups
|
|
|
|
# (group variables must be available in the input dataset for each observation).
|
|
|
|
summarizer = dict(
|
|
|
|
type=CompassArenaBradleyTerrySummarizer,
|
|
|
|
rating_system='bradleyterry',
|
2025-01-10 18:20:25 +08:00
|
|
|
report_pred_win_rates=True,
|
2024-12-31 11:01:23 +08:00
|
|
|
num_bootstrap=100,
|
|
|
|
num_cpu=None,
|
|
|
|
with_control_vars=True,
|
|
|
|
normalize_style_features=False,
|
|
|
|
odds_ratio=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
work_dir = 'outputs/subjective/bradleyterry'
|