[BugFix] Fix server crash on empty prompt (#7746)

Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
This commit is contained in:
Maximilien de Bayser
2024-08-23 10:12:44 -03:00
committed by GitHub
parent faeddb565d
commit e25fee57c2
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
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([""])