hf_internlm_chat_7b.py 776 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=[
Leymore's avatar
Leymore committed
6
7
        dict(role='HUMAN', begin='<|User|>:', end='<eoh>\n'),
        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
15
16
        abbr='internlm-chat-7b-hf',
        path="internlm-chat-7b",
        tokenizer_path='internlm-chat-7b',
yingfhu's avatar
yingfhu committed
17
18
19
        tokenizer_kwargs=dict(
            padding_side='left',
            truncation_side='left',
Leymore's avatar
Leymore committed
20
            use_fast=False,
yingfhu's avatar
yingfhu committed
21
22
23
24
25
        ),
        max_out_len=100,
        max_seq_len=2048,
        batch_size=8,
        meta_template=_meta_template,
Leymore's avatar
Leymore committed
26
        model_kwargs=dict(trust_remote_code=True, device_map='auto'),
yingfhu's avatar
yingfhu committed
27
28
29
        run_cfg=dict(num_gpus=1, num_procs=1),
    )
]