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
77ea35b9
Unverified
Commit
77ea35b9
authored
Sep 14, 2022
by
Partho
Committed by
GitHub
Sep 14, 2022
Browse files
added type hints (#19015)
parent
fc21c9be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
src/transformers/models/fsmt/modeling_fsmt.py
src/transformers/models/fsmt/modeling_fsmt.py
+18
-18
No files found.
src/transformers/models/fsmt/modeling_fsmt.py
View file @
77ea35b9
...
...
@@ -468,12 +468,12 @@ class FSMTEncoder(nn.Module):
def
forward
(
self
,
input_ids
,
attention_mask
=
None
,
head_mask
=
None
,
output_attentions
=
False
,
output_hidden_states
=
False
,
return_dict
=
True
,
input_ids
:
torch
.
Tensor
,
attention_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
output_attentions
:
bool
=
False
,
output_hidden_states
:
bool
=
False
,
return_dict
:
bool
=
True
,
):
"""
Args:
...
...
@@ -669,18 +669,18 @@ class FSMTDecoder(nn.Module):
def
forward
(
self
,
input_ids
,
encoder_hidden_states
,
encoder_padding_mask
,
decoder_padding_mask
,
decoder_causal_mask
,
head_mask
=
None
,
cross_attn_head_mask
=
None
,
past_key_values
=
None
,
use_cache
=
False
,
output_attentions
=
False
,
output_hidden_states
=
False
,
return_dict
=
True
,
input_ids
:
torch
.
Tensor
,
encoder_hidden_states
:
torch
.
Tensor
,
encoder_padding_mask
:
torch
.
Tensor
,
decoder_padding_mask
:
torch
.
Tensor
,
decoder_causal_mask
:
torch
.
Tensor
,
head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
cross_attn_head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
past_key_values
:
Optional
[
List
[
torch
.
FloatTensor
]]
=
None
,
use_cache
:
bool
=
False
,
output_attentions
:
bool
=
False
,
output_hidden_states
:
bool
=
False
,
return_dict
:
bool
=
True
,
):
"""
Includes several features from "Jointly Learning to Align and Translate with Transformer Models" (Garg et al.,
...
...
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