Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6c1b2355
Commit
6c1b2355
authored
Feb 03, 2020
by
Lysandre
Browse files
Sample instead of greedy decoding by default in generate
parent
239dd23f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+2
-2
No files found.
src/transformers/modeling_utils.py
View file @
6c1b2355
...
@@ -586,7 +586,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
...
@@ -586,7 +586,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
self
,
self
,
input_ids
=
None
,
input_ids
=
None
,
max_length
=
None
,
max_length
=
None
,
do_sample
=
Non
e
,
do_sample
=
Tru
e
,
num_beams
=
None
,
num_beams
=
None
,
temperature
=
None
,
temperature
=
None
,
top_k
=
None
,
top_k
=
None
,
...
@@ -617,7 +617,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
...
@@ -617,7 +617,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
The max length of the sequence to be generated. Between 1 and infinity. Default to 20.
The max length of the sequence to be generated. Between 1 and infinity. Default to 20.
do_sample: (`optional`) bool
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. Default
s
to
`True`
.
num_beams: (`optional`) int
num_beams: (`optional`) int
Number of beams for beam search. Must be between 1 and infinity. 1 means no beam search. Default to 1.
Number of beams for beam search. Must be between 1 and infinity. 1 means no beam search. Default to 1.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment