hf_vicuna_7b_v15_16k.py 862 Bytes
Newer Older
Leymore's avatar
Leymore committed
1
2
from opencompass.models import HuggingFaceCausalLM

3
4
5
6
7
8
_meta_template = dict(
    round=[
        dict(role="HUMAN", begin='USER: '),
        dict(role="BOT", begin=" ASSISTANT:", end='</s>', generate=True),
    ],
)
Leymore's avatar
Leymore committed
9
10
11
12

models = [
    dict(
        type=HuggingFaceCausalLM,
13
14
15
        abbr='vicuna-7b-v1.5-16k-hf',
        path="lmsys/vicuna-7b-v1.5-16k",
        tokenizer_path='lmsys/vicuna-7b-v1.5-16k',
Leymore's avatar
Leymore committed
16
17
18
19
20
        tokenizer_kwargs=dict(
            padding_side='left',
            truncation_side='left',
            use_fast=False,
        ),
21
        meta_template=_meta_template,
Leymore's avatar
Leymore committed
22
        max_out_len=100,
23
        max_seq_len=8192,
Leymore's avatar
Leymore committed
24
25
26
        batch_size=8,
        model_kwargs=dict(device_map='auto'),
        batch_padding=False, # if false, inference with for-loop without batch padding
27
28
        run_cfg=dict(num_gpus=1, num_procs=1),
        end_str='</s>',
Leymore's avatar
Leymore committed
29
30
    )
]