Skip to content

Commit cfbaaff

Browse files
rabinadk1fhl2000
authored andcommitted
Fix: Check the type of params to be a Sequence not list. (vllm-project#19910)
Signed-off-by: Rabin Adhikari <[email protected]> Signed-off-by: fhl <[email protected]>
1 parent af35cf5 commit cfbaaff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm/entrypoints/llm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,15 +1450,15 @@ def _validate_and_add_requests(
14501450
prompts = [prompts]
14511451

14521452
num_requests = len(prompts)
1453-
if isinstance(params, list) and len(params) != num_requests:
1453+
if isinstance(params, Sequence) and len(params) != num_requests:
14541454
raise ValueError("The lengths of prompts and params "
14551455
"must be the same.")
14561456
if isinstance(lora_request,
1457-
list) and len(lora_request) != num_requests:
1457+
Sequence) and len(lora_request) != num_requests:
14581458
raise ValueError("The lengths of prompts and lora_request "
14591459
"must be the same.")
14601460

1461-
for sp in params if isinstance(params, list) else (params, ):
1461+
for sp in params if isinstance(params, Sequence) else (params, ):
14621462
if isinstance(sp, SamplingParams):
14631463
self._add_guided_params(sp, guided_options)
14641464

0 commit comments

Comments
 (0)