eval_lightllm.py 892 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from mmengine.config import read_base
from opencompass.models import LightllmAPI
from opencompass.partitioners import NaivePartitioner
from opencompass.runners import LocalRunner
from opencompass.tasks import OpenICLInferTask

with read_base():
    from .datasets.humaneval.humaneval_gen import humaneval_datasets

datasets = [*humaneval_datasets]

models = [
    dict(
        abbr='LightllmAPI',
        type=LightllmAPI,
        url='http://localhost:8080/generate',
17
        input_format='<input_text_to_replace>',
18
19
        max_seq_len=2048,
        batch_size=32,
20
21
22
        generation_kwargs=dict(
            do_sample=False,
            ignore_eos=False,
23
            max_new_tokens=1024
24
25
26
27
28
29
30
31
        ),
    ),
]

infer = dict(
    partitioner=dict(type=NaivePartitioner),
    runner=dict(
        type=LocalRunner,
32
        max_num_workers=32,
33
34
35
        task=dict(type=OpenICLInferTask),
    ),
)