[BugFix] Fix min_tokens when eos_token_id is None (#4389)

Co-authored-by: DefTruth <31974251+deftruth@users.noreply.github.com>
This commit is contained in:
Nick Hill
2024-04-27 09:52:46 -07:00
committed by GitHub
parent dfea173148
commit 81661da7b2
4 changed files with 14 additions and 18 deletions

View File

@@ -185,8 +185,8 @@ class SamplingParams:
self.top_k = -1
self.min_p = 0.0
self._verify_greedy_sampling()
# injected by the engine
self.eos_token_id = None
# eos_token_id is added to this by the engine
self.all_stop_token_ids = set(self.stop_token_ids)
def _verify_args(self) -> None:
if self.n < 1: