test_init.py 689 Bytes
Newer Older
1
2
# SPDX-License-Identifier: Apache-2.0

zhuwenwen's avatar
zhuwenwen committed
3
import os
4
5
6
7
import pytest

from vllm import LLM

zhuwenwen's avatar
zhuwenwen committed
8
from ...utils import error_on_warning, models_path_prefix
9

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


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")