2023-11-21 22:34:46 +08:00
|
|
|
from mmengine.config import read_base
|
2025-01-20 19:17:38 +08:00
|
|
|
|
2023-11-21 22:34:46 +08:00
|
|
|
from opencompass.models.turbomind import TurboMindModel
|
|
|
|
|
|
|
|
with read_base():
|
|
|
|
# choose a list of datasets
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.configs.datasets.ceval.ceval_gen_5f30c7 import \
|
|
|
|
ceval_datasets
|
|
|
|
from opencompass.configs.datasets.crowspairs.crowspairs_gen_381af0 import \
|
|
|
|
crowspairs_datasets
|
|
|
|
from opencompass.configs.datasets.gsm8k.gsm8k_gen_1d7fe4 import \
|
|
|
|
gsm8k_datasets
|
2024-08-22 14:48:45 +08:00
|
|
|
from opencompass.configs.datasets.mmlu.mmlu_gen_a484b3 import mmlu_datasets
|
|
|
|
from opencompass.configs.datasets.race.race_gen_69ee4f import race_datasets
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.configs.datasets.SuperGLUE_WiC.SuperGLUE_WiC_gen_d06864 import \
|
|
|
|
WiC_datasets
|
|
|
|
from opencompass.configs.datasets.SuperGLUE_WSC.SuperGLUE_WSC_gen_7902a7 import \
|
|
|
|
WSC_datasets
|
|
|
|
from opencompass.configs.datasets.triviaqa.triviaqa_gen_2121ce import \
|
|
|
|
triviaqa_datasets
|
2023-11-21 22:34:46 +08:00
|
|
|
# and output the results in a choosen format
|
2024-08-22 14:48:45 +08:00
|
|
|
from opencompass.configs.summarizers.medium import summarizer
|
2023-11-21 22:34:46 +08:00
|
|
|
|
|
|
|
datasets = sum((v for k, v in locals().items() if k.endswith('_datasets')), [])
|
|
|
|
|
2023-12-21 18:22:17 +08:00
|
|
|
internlm_meta_template = dict(round=[
|
|
|
|
dict(role='HUMAN', begin='<|User|>:', end='\n'),
|
|
|
|
dict(role='BOT', begin='<|Bot|>:', end='<eoa>\n', generate=True),
|
|
|
|
],
|
|
|
|
eos_token_id=103028)
|
2023-11-21 22:34:46 +08:00
|
|
|
|
2025-01-20 19:17:38 +08:00
|
|
|
internlm2_meta_template = dict(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),
|
|
|
|
],
|
|
|
|
eos_token_id=92542)
|
2024-02-01 22:31:14 +08:00
|
|
|
|
2023-11-21 22:34:46 +08:00
|
|
|
# config for internlm-chat-7b
|
2023-12-21 18:22:17 +08:00
|
|
|
internlm_chat_7b = dict(
|
|
|
|
type=TurboMindModel,
|
|
|
|
abbr='internlm-chat-7b-turbomind',
|
2024-01-17 11:09:50 +08:00
|
|
|
path='internlm/internlm-chat-7b',
|
2024-01-18 14:41:35 +08:00
|
|
|
engine_config=dict(session_len=2048,
|
|
|
|
max_batch_size=32,
|
|
|
|
rope_scaling_factor=1.0),
|
2025-01-20 19:17:38 +08:00
|
|
|
gen_config=dict(top_k=1, top_p=0.8, temperature=1.0, max_new_tokens=100),
|
2023-12-21 18:22:17 +08:00
|
|
|
max_out_len=100,
|
|
|
|
max_seq_len=2048,
|
|
|
|
batch_size=32,
|
|
|
|
concurrency=32,
|
|
|
|
meta_template=internlm_meta_template,
|
|
|
|
run_cfg=dict(num_gpus=1, num_procs=1),
|
2024-02-01 22:31:14 +08:00
|
|
|
end_str='<eoa>',
|
|
|
|
)
|
|
|
|
|
|
|
|
# config for internlm-chat-7b
|
2025-01-20 19:17:38 +08:00
|
|
|
internlm2_chat_7b = dict(type=TurboMindModel,
|
|
|
|
abbr='internlm2-chat-7b-turbomind',
|
|
|
|
path='internlm/internlm2-chat-7b',
|
|
|
|
engine_config=dict(session_len=2048,
|
|
|
|
max_batch_size=32,
|
|
|
|
rope_scaling_factor=1.0),
|
|
|
|
gen_config=dict(top_k=1,
|
|
|
|
top_p=0.8,
|
|
|
|
temperature=1.0,
|
|
|
|
max_new_tokens=100),
|
|
|
|
max_out_len=100,
|
|
|
|
max_seq_len=2048,
|
|
|
|
batch_size=32,
|
|
|
|
concurrency=32,
|
|
|
|
meta_template=internlm2_meta_template,
|
|
|
|
run_cfg=dict(num_gpus=1, num_procs=1),
|
|
|
|
end_str='<|im_end|>')
|
2023-11-21 22:34:46 +08:00
|
|
|
|
|
|
|
# config for internlm-chat-20b
|
2023-12-21 18:22:17 +08:00
|
|
|
internlm_chat_20b = dict(
|
|
|
|
type=TurboMindModel,
|
|
|
|
abbr='internlm-chat-20b-turbomind',
|
2024-01-17 11:09:50 +08:00
|
|
|
path='internlm/internlm-chat-20b',
|
2024-01-18 14:41:35 +08:00
|
|
|
engine_config=dict(session_len=2048,
|
|
|
|
max_batch_size=8,
|
|
|
|
rope_scaling_factor=1.0),
|
2025-01-20 19:17:38 +08:00
|
|
|
gen_config=dict(top_k=1, top_p=0.8, temperature=1.0, max_new_tokens=100),
|
2023-12-21 18:22:17 +08:00
|
|
|
max_out_len=100,
|
|
|
|
max_seq_len=2048,
|
|
|
|
batch_size=8,
|
|
|
|
concurrency=8,
|
|
|
|
meta_template=internlm_meta_template,
|
|
|
|
run_cfg=dict(num_gpus=1, num_procs=1),
|
2024-02-01 22:31:14 +08:00
|
|
|
end_str='<eoa>',
|
2023-12-21 18:22:17 +08:00
|
|
|
)
|
2023-11-21 22:34:46 +08:00
|
|
|
|
2023-12-21 18:22:17 +08:00
|
|
|
models = [internlm_chat_20b]
|