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
d054da19
Unverified
Commit
d054da19
authored
Jun 04, 2025
by
CYJiang
Committed by
GitHub
Jun 03, 2025
Browse files
[Misc] fix: add miss best_of param validation (#18555)
Signed-off-by:
googs1025
<
googs1025@gmail.com
>
parent
4b7817c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
vllm/sampling_params.py
vllm/sampling_params.py
+11
-0
No files found.
vllm/sampling_params.py
View file @
d054da19
...
...
@@ -389,6 +389,17 @@ class SamplingParams(
f
"type
{
type
(
self
.
n
)
}
"
)
if
self
.
n
<
1
:
raise
ValueError
(
f
"n must be at least 1, got
{
self
.
n
}
."
)
if
self
.
best_of
is
not
None
:
if
not
isinstance
(
self
.
best_of
,
int
):
raise
ValueError
(
f
"best_of must be an integer, got
{
type
(
self
.
best_of
)
}
"
)
if
self
.
best_of
<
1
:
raise
ValueError
(
f
"best_of must be at least 1, got
{
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
}
."
)
if
not
-
2.0
<=
self
.
presence_penalty
<=
2.0
:
raise
ValueError
(
"presence_penalty must be in [-2, 2], got "
f
"
{
self
.
presence_penalty
}
."
)
...
...
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