Skip to content

Commit

Permalink
Fix max_length argument in generate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Apr 20, 2021
1 parent 6e8e9c9 commit 616a4e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/transformers/generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ def generate(
"""

# set init values
max_length = max_length if max_length is not None else self.config.max_length
num_beams = num_beams if num_beams is not None else self.config.num_beams
num_beam_groups = num_beam_groups if num_beam_groups is not None else self.config.num_beam_groups
do_sample = do_sample if do_sample is not None else self.config.do_sample
Expand Down

0 comments on commit 616a4e4

Please sign in to comment.