vllm/tests/entrypoints/llm/test_prompt_validation.py
Maximilien de Bayser e25fee57c2
[BugFix] Fix server crash on empty prompt (#7746)
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
2024-08-23 13:12:44 +00:00

10 lines
186 B
Python

import pytest
from vllm import LLM
def test_empty_prompt():
llm = LLM(model="gpt2")
with pytest.raises(ValueError, match='Prompt cannot be empty'):
llm.generate([""])