test_prompt_validation.py 270 Bytes
Newer Older
1
import pytest
2
import os
3
4

from vllm import LLM
5
from ...utils import models_path_prefix
6
7
8


def test_empty_prompt():
9
    llm = LLM(model=os.path.join(models_path_prefix, "gpt2"))
10
11
    with pytest.raises(ValueError, match='Prompt cannot be empty'):
        llm.generate([""])