[bugfix] fixed parameter “n” when set parameter “bestof” > 1 (#10854)

Signed-off-by: jianzheng <57654625+o2363286@users.noreply.github.com>
This commit is contained in:
jianzheng 2024-12-04 16:48:22 +08:00 committed by GitHub
parent c9ca4fce3f
commit 8db957ee3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -293,8 +293,9 @@ class SamplingParams(
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(