Skip to content

Commit

Permalink
fix (#233)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Habib <[email protected]>
  • Loading branch information
clefourrier and NathanHB authored Jul 24, 2024
1 parent 2b4b637 commit db502dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lighteval/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ def greedy_until(
# There will be truncation of at least one sample, maximum generation size will be one
max_new_tokens = 1
else: # We can't allow generation of more than max_length
max_new_tokens = min(self.max_length - context_size, max_new_tokens)
if max_new_tokens is None: # If generation size is not set, we go all the way
max_new_tokens = self.max_length - context_size
else:
max_new_tokens = min(self.max_length - context_size, max_new_tokens)

prepared_batch = Batch(
input_ids=tokenized["input_ids"],
Expand Down

0 comments on commit db502dd

Please sign in to comment.