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
b28298f2
Unverified
Commit
b28298f2
authored
Sep 20, 2024
by
saumya-saran
Committed by
GitHub
Sep 20, 2024
Browse files
[Bugfix] Validate SamplingParam n is an int (#8548)
parent
2940afa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vllm/sampling_params.py
vllm/sampling_params.py
+6
-1
No files found.
vllm/sampling_params.py
View file @
b28298f2
...
...
@@ -273,9 +273,14 @@ class SamplingParams(
self
.
_all_stop_token_ids
=
set
(
self
.
stop_token_ids
)
def
_verify_args
(
self
)
->
None
:
if
not
isinstance
(
self
.
n
,
int
):
raise
ValueError
(
f
"n must be an int, but is of "
f
"type
{
type
(
self
.
n
)
}
"
)
if
self
.
n
<
1
:
raise
ValueError
(
f
"n must be at least 1, got
{
self
.
n
}
."
)
assert
isinstance
(
self
.
best_of
,
int
)
if
not
isinstance
(
self
.
best_of
,
int
):
raise
ValueError
(
f
'best_of must be an int, but is of '
f
'type
{
type
(
self
.
best_of
)
}
'
)
if
self
.
best_of
<
self
.
n
:
raise
ValueError
(
f
"best_of must be greater than or equal to n, "
f
"got n=
{
self
.
n
}
and best_of=
{
self
.
best_of
}
."
)
...
...
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