[generate] do_sample default back to False (#3298)
* change do_samples back * None better default as boolean * adapt do_sample to True in test example * make style
This commit is contained in:
committed by
GitHub
parent
2187c49f5c
commit
e8f44af5bf
@@ -656,8 +656,8 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
|
||||
input_ids=None,
|
||||
max_length=None,
|
||||
min_length=None,
|
||||
do_sample=True,
|
||||
early_stopping=False,
|
||||
do_sample=None,
|
||||
early_stopping=None,
|
||||
num_beams=None,
|
||||
temperature=None,
|
||||
top_k=None,
|
||||
@@ -691,7 +691,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
|
||||
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. Defaults to `True`.
|
||||
If set to `False` greedy decoding is used. Otherwise sampling is used. Defaults to `False`.
|
||||
|
||||
num_beams: (`optional`) int
|
||||
Number of beams for beam search. Must be between 1 and infinity. 1 means no beam search. Default to 1.
|
||||
|
||||
Reference in New Issue
Block a user