test_async_engine.py 826 Bytes
Newer Older
zhouxiang's avatar
zhouxiang committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest

from lmdeploy.messages import PytorchEngineConfig, TurbomindEngineConfig
from lmdeploy.model import ChatTemplateConfig
from lmdeploy.serve.async_engine import deduce_a_name


@pytest.mark.parametrize(
    'backend_config',
    [TurbomindEngineConfig('internlm'),
     PytorchEngineConfig(None), None])
@pytest.mark.parametrize(
    'chat_template_config',
    [ChatTemplateConfig('internlm'),
     ChatTemplateConfig(None), None])
@pytest.mark.parametrize('model_name', ['internlm', None])
@pytest.mark.parametrize('model_path', ['/path/to/internlm-chat-7b'])
def test_deduce_a_name(model_path, model_name, chat_template_config,
                       backend_config):
    name = deduce_a_name(model_path, model_name, chat_template_config,
                         backend_config)
    assert name == 'internlm'