Skip to content

Commit 598e47d

Browse files
committed
Updated parse_raw_prompt control flow to raise ValueError for empty nested list inputs
Signed-off-by: Kayvan Mivehnejad <[email protected]>
1 parent bb592f1 commit 598e47d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vllm/inputs/parse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def parse_raw_prompts(
4545

4646
# case 4: array of token arrays
4747
if is_list_of(prompt, list):
48+
if len(prompt) == 0 or (
49+
len(prompt) == 1 and isinstance(prompt[0], list) and len(prompt[0]) == 0
50+
):
51+
raise ValueError("please provide at least one prompt")
4852
for elem in prompt:
4953
if not isinstance(elem, list):
5054
raise TypeError(

0 commit comments

Comments
 (0)