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
"tests/models/vscode:/vscode.git/clone" did not exist on "648bd5a8aad926d611d900d3d202dce37e085359"
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
Show 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):
...
@@ -468,12 +468,12 @@ class FSMTEncoder(nn.Module):
def
forward
(
def
forward
(
self
,
self
,
input_ids
,
input_ids
:
torch
.
Tensor
,
attention_mask
=
None
,
attention_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
head_mask
=
None
,
head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
output_attentions
=
False
,
output_attentions
:
bool
=
False
,
output_hidden_states
=
False
,
output_hidden_states
:
bool
=
False
,
return_dict
=
True
,
return_dict
:
bool
=
True
,
):
):
"""
"""
Args:
Args:
...
@@ -669,18 +669,18 @@ class FSMTDecoder(nn.Module):
...
@@ -669,18 +669,18 @@ class FSMTDecoder(nn.Module):
def
forward
(
def
forward
(
self
,
self
,
input_ids
,
input_ids
:
torch
.
Tensor
,
encoder_hidden_states
,
encoder_hidden_states
:
torch
.
Tensor
,
encoder_padding_mask
,
encoder_padding_mask
:
torch
.
Tensor
,
decoder_padding_mask
,
decoder_padding_mask
:
torch
.
Tensor
,
decoder_causal_mask
,
decoder_causal_mask
:
torch
.
Tensor
,
head_mask
=
None
,
head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
cross_attn_head_mask
=
None
,
cross_attn_head_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
past_key_values
=
None
,
past_key_values
:
Optional
[
List
[
torch
.
FloatTensor
]]
=
None
,
use_cache
=
False
,
use_cache
:
bool
=
False
,
output_attentions
=
False
,
output_attentions
:
bool
=
False
,
output_hidden_states
=
False
,
output_hidden_states
:
bool
=
False
,
return_dict
=
True
,
return_dict
:
bool
=
True
,
):
):
"""
"""
Includes several features from "Jointly Learning to Align and Translate with Transformer Models" (Garg et al.,
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