Fix typo in sampling_params.py (#788)

This commit is contained in:
wangcx18 2023-08-18 09:12:46 +08:00 committed by GitHub
parent 73b3de79ea
commit 0c04ce3234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ class SamplingParams:
self._verify_args() self._verify_args()
if self.use_beam_search: if self.use_beam_search:
self._verity_beam_search() self._verify_beam_search()
elif self.temperature < _SAMPLING_EPS: elif self.temperature < _SAMPLING_EPS:
# Zero temperature means greedy sampling. # Zero temperature means greedy sampling.
self._verify_greedy_sampling() self._verify_greedy_sampling()
@ -109,7 +109,7 @@ class SamplingParams:
raise ValueError( raise ValueError(
f"logprobs must be non-negative, got {self.logprobs}.") f"logprobs must be non-negative, got {self.logprobs}.")
def _verity_beam_search(self) -> None: def _verify_beam_search(self) -> None:
if self.best_of == 1: if self.best_of == 1:
raise ValueError("best_of must be greater than 1 when using beam " raise ValueError("best_of must be greater than 1 when using beam "
f"search. Got {self.best_of}.") f"search. Got {self.best_of}.")