forked from open-compass/opencompass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheval_livestembench.py
More file actions
66 lines (55 loc) · 2 KB
/
eval_livestembench.py
File metadata and controls
66 lines (55 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from mmengine.config import read_base
from opencompass.models import OpenAISDK
with read_base():
# 选择一个数据集列表
from opencompass.configs.datasets.livestembench.livestembench_gen_3e3c50 import \
livestembench_datasets
# 选择一个感兴趣的模型
from opencompass.configs.models.qwen2_5.lmdeploy_qwen2_5_7b_instruct import \
models as qwen2_5_7b_instruct_lmdeploy_model
from opencompass.configs.models.qwen2_5.lmdeploy_qwen2_5_72b_instruct import \
models as qwen2_5_72b_instruct_lmdeploy_model
datasets = sum([v for k, v in locals().items() if k.endswith('_datasets')], [])
models = [
*qwen2_5_7b_instruct_lmdeploy_model, *qwen2_5_72b_instruct_lmdeploy_model
]
# Judge 模型配置
api_meta_template = dict(round=[
dict(role='HUMAN', api_role='HUMAN'),
dict(role='BOT', api_role='BOT', generate=True),
], )
judge_cfg = dict(
abbr='qwen2-5-72b-instruct',
type=OpenAISDK,
path='YOUR_SERVER_MODEL_NAME', # 你的部署的模型名称
key='None',
openai_api_base=[
'http://localhost:23333/v1', # 你的模型部署的地址
],
meta_template=api_meta_template,
query_per_second=16,
batch_size=16,
temperature=0.001,
max_completion_tokens=32768,
)
for dataset in datasets:
dataset['eval_cfg']['evaluator']['judge_cfg'] = judge_cfg
# -------------Inferen Stage ----------------------------------------
from opencompass.partitioners import NaivePartitioner, NumWorkerPartitioner
from opencompass.runners import LocalRunner
from opencompass.tasks import OpenICLEvalTask, OpenICLInferTask
infer = dict(
partitioner=dict(type=NumWorkerPartitioner, num_worker=8),
runner=dict(type=LocalRunner,
max_num_workers=8,
task=dict(type=OpenICLInferTask)),
)
eval = dict(
partitioner=dict(type=NaivePartitioner, n=8),
runner=dict(
type=LocalRunner,
max_num_workers=256,
task=dict(type=OpenICLEvalTask),
),
)
work_dir = './outputs/livestembench'