[Bugfix] Use random seed if seed is -1 (#4531)

This commit is contained in:
sasha0552 2024-05-01 17:41:17 +00:00 committed by GitHub
parent e491c7e053
commit 69909126a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,10 @@ class SamplingParams:
self.top_p = top_p
self.top_k = top_k
self.min_p = min_p
self.seed = seed
if seed == -1:
self.seed = None
else:
self.seed = seed
self.use_beam_search = use_beam_search
self.length_penalty = length_penalty
self.early_stopping = early_stopping