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
9bd67ac7
Unverified
Commit
9bd67ac7
authored
May 12, 2022
by
Suraj Patil
Committed by
GitHub
May 12, 2022
Browse files
update BART docs (#17212)
parent
30be0da5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
src/transformers/models/bart/modeling_bart.py
src/transformers/models/bart/modeling_bart.py
+3
-3
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
...ormers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
+2
-2
src/transformers/models/opt/modeling_opt.py
src/transformers/models/opt/modeling_opt.py
+3
-3
src/transformers/models/speech_to_text/modeling_speech_to_text.py
...sformers/models/speech_to_text/modeling_speech_to_text.py
+3
-3
templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py
...elname}}/modeling_{{cookiecutter.lowercase_modelname}}.py
+1
-1
No files found.
src/transformers/models/bart/modeling_bart.py
View file @
9bd67ac7
...
@@ -624,9 +624,9 @@ BART_INPUTS_DOCSTRING = r"""
...
@@ -624,9 +624,9 @@ BART_INPUTS_DOCSTRING = r"""
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
be used by default.
be used by default.
If you want to change padding behavior, you should read [`modeling_bart._prepare_decoder_
inputs`] and
If you want to change padding behavior, you should read [`modeling_bart._prepare_decoder_
attention_mask`]
modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
information
and
modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
on the default strategy.
information
on the default strategy.
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
...
...
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
View file @
9bd67ac7
...
@@ -1685,8 +1685,8 @@ BIGBIRD_PEGASUS_INPUTS_DOCSTRING = r"""
...
@@ -1685,8 +1685,8 @@ BIGBIRD_PEGASUS_INPUTS_DOCSTRING = r"""
be used by default.
be used by default.
If you want to change padding behavior, you should read
If you want to change padding behavior, you should read
[`modeling_bigbird_pegasus._prepare_decoder_
inputs
`] and modify to your needs. See diagram 1 in
[the
[`modeling_bigbird_pegasus._prepare_decoder_
attention_mask
`] and modify to your needs. See diagram 1 in
paper](https://arxiv.org/abs/1910.13461) for more information on the default strategy.
[the
paper](https://arxiv.org/abs/1910.13461) for more information on the default strategy.
decoder_head_mask (`torch.Tensor` of shape `(num_layers, num_heads)`, *optional*):
decoder_head_mask (`torch.Tensor` of shape `(num_layers, num_heads)`, *optional*):
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in `[0, 1]`:
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in `[0, 1]`:
...
...
src/transformers/models/opt/modeling_opt.py
View file @
9bd67ac7
...
@@ -464,9 +464,9 @@ OPT_INPUTS_DOCSTRING = r"""
...
@@ -464,9 +464,9 @@ OPT_INPUTS_DOCSTRING = r"""
If `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
If `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
`past_key_values`).
`past_key_values`).
If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_
inputs`] and modify
If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_
attention_mask`]
to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
information on the
and modify
to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
default strategy.
information on the
default strategy.
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
...
...
src/transformers/models/speech_to_text/modeling_speech_to_text.py
View file @
9bd67ac7
...
@@ -625,9 +625,9 @@ SPEECH_TO_TEXT_INPUTS_DOCSTRING = r"""
...
@@ -625,9 +625,9 @@ SPEECH_TO_TEXT_INPUTS_DOCSTRING = r"""
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
be used by default.
be used by default.
If you want to change padding behavior, you should read
[`modeling_speech_to_text._prepare_decoder_inputs`]
If you want to change padding behavior, you should read
and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for mor
e
[`modeling_speech_to_text._prepare_decoder_attention_mask`] and modify to your needs. See diagram 1 in [th
e
information on the default strategy.
paper](https://arxiv.org/abs/1910.13461) for more
information on the default strategy.
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in `[0, 1]`:
...
...
templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py
View file @
9bd67ac7
...
@@ -2100,7 +2100,7 @@ class {{cookiecutter.camelcase_modelname}}PreTrainedModel(PreTrainedModel):
...
@@ -2100,7 +2100,7 @@ class {{cookiecutter.camelcase_modelname}}PreTrainedModel(PreTrainedModel):
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will
Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will
also be used by default.
also be used by default.
If you want to change padding behavior, you should read [`modeling_{{cookiecutter.lowercase_modelname}}._prepare_decoder_
inputs
`] and
If you want to change padding behavior, you should read [`modeling_{{cookiecutter.lowercase_modelname}}._prepare_decoder_
attention_mask
`] and
modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
information on the default strategy.
information on the default strategy.
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
head_mask (`torch.Tensor` of shape `(encoder_layers, encoder_attention_heads)`, *optional*):
...
...
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