Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
8262a3e2
Unverified
Commit
8262a3e2
authored
Apr 27, 2025
by
Nick Hill
Committed by
GitHub
Apr 28, 2025
Browse files
[Misc] Validate `stop_token_ids` contents (#17268)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
f211331c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
vllm/sampling_params.py
vllm/sampling_params.py
+4
-0
No files found.
vllm/sampling_params.py
View file @
8262a3e2
...
@@ -437,6 +437,10 @@ class SamplingParams(
...
@@ -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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment