hf_internlm_chat_7b.py 885 Bytes
Newer Older
yingfhu's avatar
yingfhu committed
1
2
from opencompass.models import HuggingFaceCausalLM

Leymore's avatar
Leymore committed
3

yingfhu's avatar
yingfhu committed
4
5
_meta_template = dict(
    round=[
6
        dict(role='HUMAN', begin='<|User|>:', end='\n'),
Leymore's avatar
Leymore committed
7
        dict(role='BOT', begin='<|Bot|>:', end='<eoa>\n', generate=True),
yingfhu's avatar
yingfhu committed
8
9
10
11
12
13
    ],
)

models = [
    dict(
        type=HuggingFaceCausalLM,
Leymore's avatar
Leymore committed
14
        abbr='internlm-chat-7b-hf',
15
        path='internlm/internlm-chat-7b',
Leymore's avatar
Leymore committed
16
        tokenizer_path='internlm/internlm-chat-7b',
17
18
19
20
        model_kwargs=dict(
            trust_remote_code=True,
            device_map='auto',
        ),
yingfhu's avatar
yingfhu committed
21
22
23
        tokenizer_kwargs=dict(
            padding_side='left',
            truncation_side='left',
Leymore's avatar
Leymore committed
24
            use_fast=False,
Leymore's avatar
Leymore committed
25
            trust_remote_code=True,
yingfhu's avatar
yingfhu committed
26
27
28
29
30
31
        ),
        max_out_len=100,
        max_seq_len=2048,
        batch_size=8,
        meta_template=_meta_template,
        run_cfg=dict(num_gpus=1, num_procs=1),
Hubert's avatar
Hubert committed
32
        end_str='<eoa>',
yingfhu's avatar
yingfhu committed
33
    )
34
]