Skip to content

Commit

Permalink
[bugfix] fixed parameter “n” when set parameter “bestof” > 1 (vllm-pr…
Browse files Browse the repository at this point in the history
…oject#10854)

Signed-off-by: jianzheng <[email protected]>
  • Loading branch information
o2363286 authored Dec 4, 2024
1 parent c9ca4fc commit 8db957e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vllm/sampling_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ def __post_init__(self) -> None:
raise ValueError(
f"best_of must be greater than or equal to n, "
f"got n={self.n} and best_of={self.best_of}.")
self._real_n = self.n
self.n = self.best_of
if not self._real_n:
self._real_n = self.n
self.n = self.best_of

if 0 < self.temperature < _MAX_TEMP:
logger.warning(
Expand Down

0 comments on commit 8db957e

Please sign in to comment.