Unverified Commit 8ca81bb0 authored by Rabin Adhikari's avatar Rabin Adhikari Committed by GitHub
Browse files

Fix: Check the type of params to be a Sequence not list. (#19910)


Signed-off-by: default avatarRabin Adhikari <rabin.adk1@gmail.com>
parent e773a9e1
...@@ -1450,15 +1450,15 @@ class LLM: ...@@ -1450,15 +1450,15 @@ class LLM:
prompts = [prompts] prompts = [prompts]
num_requests = len(prompts) num_requests = len(prompts)
if isinstance(params, list) and len(params) != num_requests: if isinstance(params, Sequence) and len(params) != num_requests:
raise ValueError("The lengths of prompts and params " raise ValueError("The lengths of prompts and params "
"must be the same.") "must be the same.")
if isinstance(lora_request, if isinstance(lora_request,
list) and len(lora_request) != num_requests: Sequence) and len(lora_request) != num_requests:
raise ValueError("The lengths of prompts and lora_request " raise ValueError("The lengths of prompts and lora_request "
"must be the same.") "must be the same.")
for sp in params if isinstance(params, list) else (params, ): for sp in params if isinstance(params, Sequence) else (params, ):
if isinstance(sp, SamplingParams): if isinstance(sp, SamplingParams):
self._add_guided_params(sp, guided_options) self._add_guided_params(sp, guided_options)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment