mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-14 08:54:35 +08:00
[Misc] Validate stop_token_ids contents (#17268)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
f211331c48
commit
8262a3e23b
@ -437,6 +437,10 @@ class SamplingParams(
|
|||||||
and self.truncate_prompt_tokens < 1):
|
and self.truncate_prompt_tokens < 1):
|
||||||
raise ValueError(f"truncate_prompt_tokens must be >= 1, "
|
raise ValueError(f"truncate_prompt_tokens must be >= 1, "
|
||||||
f"got {self.truncate_prompt_tokens}")
|
f"got {self.truncate_prompt_tokens}")
|
||||||
|
assert isinstance(self.stop_token_ids, list)
|
||||||
|
if not all(isinstance(st_id, int) for st_id in self.stop_token_ids):
|
||||||
|
raise ValueError(f"stop_token_ids must contain only integers, "
|
||||||
|
f"got {self.stop_token_ids}.")
|
||||||
assert isinstance(self.stop, list)
|
assert isinstance(self.stop, list)
|
||||||
if any(not stop_str for stop_str in self.stop):
|
if any(not stop_str for stop_str in self.stop):
|
||||||
raise ValueError("stop cannot contain an empty string.")
|
raise ValueError("stop cannot contain an empty string.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user