test_init.py 650 Bytes
Newer Older
zhuwenwen's avatar
zhuwenwen committed
1
import os
2
3
4
5
import pytest

from vllm import LLM

zhuwenwen's avatar
zhuwenwen committed
6
from ...utils import error_on_warning, models_path_prefix
7

zhuwenwen's avatar
zhuwenwen committed
8
MODEL_NAME = os.path.join(models_path_prefix, "facebook/opt-125m")
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


def test_pos_args_deprecated():
    with error_on_warning(DeprecationWarning):
        LLM(model=MODEL_NAME, tokenizer=MODEL_NAME)

    with error_on_warning(DeprecationWarning):
        LLM(MODEL_NAME, tokenizer=MODEL_NAME)

    with pytest.warns(DeprecationWarning, match="'tokenizer'"):
        LLM(MODEL_NAME, MODEL_NAME)

    with pytest.warns(DeprecationWarning,
                      match="'tokenizer', 'tokenizer_mode'"):
        LLM(MODEL_NAME, MODEL_NAME, "auto")