2023-11-21 19:18:40 +08:00
|
|
|
from mmengine.config import read_base
|
2025-01-20 19:17:38 +08:00
|
|
|
|
2023-11-21 19:18:40 +08:00
|
|
|
from opencompass.models import LightllmAPI
|
|
|
|
from opencompass.partitioners import NaivePartitioner
|
|
|
|
from opencompass.runners import LocalRunner
|
|
|
|
from opencompass.tasks import OpenICLInferTask
|
|
|
|
|
|
|
|
with read_base():
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.configs.datasets.humaneval.deprecated_humaneval_gen_a82cae import \
|
|
|
|
humaneval_datasets
|
2024-08-22 14:48:45 +08:00
|
|
|
from opencompass.configs.summarizers.leaderboard import summarizer
|
2023-11-21 19:18:40 +08:00
|
|
|
|
|
|
|
datasets = [*humaneval_datasets]
|
2024-03-06 15:33:53 +08:00
|
|
|
'''
|
|
|
|
# Prompt template for InternLM2-Chat
|
|
|
|
# https://github.com/InternLM/InternLM/blob/main/chat/chat_format.md
|
|
|
|
|
|
|
|
_meta_template = dict(
|
|
|
|
begin='<|im_start|>system\nYou are InternLM2-Chat, a harmless AI assistant<|im_end|>\n',
|
|
|
|
round=[
|
|
|
|
dict(role='HUMAN', begin='<|im_start|>user\n', end='<|im_end|>\n'),
|
|
|
|
dict(role='BOT', begin='<|im_start|>assistant\n', end='<|im_end|>\n', generate=True),
|
|
|
|
]
|
|
|
|
)
|
|
|
|
'''
|
|
|
|
|
|
|
|
_meta_template = None
|
|
|
|
|
2023-11-21 19:18:40 +08:00
|
|
|
models = [
|
|
|
|
dict(
|
|
|
|
abbr='LightllmAPI',
|
|
|
|
type=LightllmAPI,
|
2024-03-06 15:33:53 +08:00
|
|
|
url='http://localhost:1030/generate',
|
|
|
|
meta_template=_meta_template,
|
2023-12-27 13:49:08 +08:00
|
|
|
batch_size=32,
|
2024-04-30 22:09:22 +08:00
|
|
|
max_workers_per_task=128,
|
|
|
|
rate_per_worker=1024,
|
2024-03-06 15:33:53 +08:00
|
|
|
retry=4,
|
2025-01-20 19:17:38 +08:00
|
|
|
generation_kwargs=dict(do_sample=False,
|
|
|
|
ignore_eos=False,
|
|
|
|
max_new_tokens=1024),
|
2023-11-21 19:18:40 +08:00
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
infer = dict(
|
|
|
|
partitioner=dict(type=NaivePartitioner),
|
|
|
|
runner=dict(
|
|
|
|
type=LocalRunner,
|
2023-12-27 13:49:08 +08:00
|
|
|
max_num_workers=32,
|
2023-11-21 19:18:40 +08:00
|
|
|
task=dict(type=OpenICLInferTask),
|
|
|
|
),
|
|
|
|
)
|