Skip to content

Commit

Permalink
Sample instead of greedy decoding by default in generate
Browse files Browse the repository at this point in the history
  • Loading branch information
LysandreJik committed Feb 3, 2020
1 parent 239dd23 commit 6c1b235
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def generate(
self,
input_ids=None,
max_length=None,
do_sample=None,
do_sample=True,
num_beams=None,
temperature=None,
top_k=None,
Expand Down Expand Up @@ -617,7 +617,7 @@ def generate(
The max length of the sequence to be generated. Between 1 and infinity. Default to 20.
do_sample: (`optional`) bool
If set to `False` greedy decoding is used. Otherwise sampling is used. Default to greedy sampling.
If set to `False` greedy decoding is used. Otherwise sampling is used. Defaults to `True`.
num_beams: (`optional`) int
Number of beams for beam search. Must be between 1 and infinity. 1 means no beam search. Default to 1.
Expand Down

0 comments on commit 6c1b235

Please sign in to comment.