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
ac5ea74e
Unverified
Commit
ac5ea74e
authored
Oct 04, 2022
by
IMvision12
Committed by
GitHub
Oct 04, 2022
Browse files
Added Type hints for LED TF (#19315)
* Update modeling_tf_led.py * Update modeling_tf_led.py
parent
3a1a56a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
src/transformers/models/led/modeling_tf_led.py
src/transformers/models/led/modeling_tf_led.py
+18
-16
No files found.
src/transformers/models/led/modeling_tf_led.py
View file @
ac5ea74e
...
@@ -19,6 +19,7 @@ import random
...
@@ -19,6 +19,7 @@ import random
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
typing
import
List
,
Optional
,
Tuple
,
Union
from
typing
import
List
,
Optional
,
Tuple
,
Union
import
numpy
as
np
import
tensorflow
as
tf
import
tensorflow
as
tf
from
...activations_tf
import
get_tf_activation
from
...activations_tf
import
get_tf_activation
...
@@ -26,6 +27,7 @@ from ...modeling_tf_outputs import TFBaseModelOutputWithPastAndCrossAttentions
...
@@ -26,6 +27,7 @@ from ...modeling_tf_outputs import TFBaseModelOutputWithPastAndCrossAttentions
# Public API
# Public API
from
...modeling_tf_utils
import
(
from
...modeling_tf_utils
import
(
TFModelInputType
,
TFPreTrainedModel
,
TFPreTrainedModel
,
TFSharedEmbeddings
,
TFSharedEmbeddings
,
TFWrappedEmbeddings
,
TFWrappedEmbeddings
,
...
@@ -2390,23 +2392,23 @@ class TFLEDForConditionalGeneration(TFLEDPreTrainedModel):
...
@@ -2390,23 +2392,23 @@ class TFLEDForConditionalGeneration(TFLEDPreTrainedModel):
@
replace_return_docstrings
(
output_type
=
TFLEDSeq2SeqLMOutput
,
config_class
=
_CONFIG_FOR_DOC
)
@
replace_return_docstrings
(
output_type
=
TFLEDSeq2SeqLMOutput
,
config_class
=
_CONFIG_FOR_DOC
)
def
call
(
def
call
(
self
,
self
,
input_ids
=
None
,
input_ids
:
Optional
[
TFModelInputType
]
=
None
,
attention_mask
=
None
,
attention_mask
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
decoder_input_ids
=
None
,
decoder_input_ids
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
decoder_attention_mask
=
None
,
decoder_attention_mask
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
head_mask
=
None
,
head_mask
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
decoder_head_mask
=
None
,
decoder_head_mask
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
encoder_outputs
:
Optional
[
TFLEDEncoderBaseModelOutput
]
=
None
,
encoder_outputs
:
Optional
[
TFLEDEncoderBaseModelOutput
]
=
None
,
global_attention_mask
=
None
,
global_attention_mask
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
past_key_values
=
None
,
past_key_values
:
Optional
[
Tuple
[
Tuple
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]]]
=
None
,
inputs_embeds
=
None
,
inputs_embeds
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
decoder_inputs_embeds
=
None
,
decoder_inputs_embeds
:
Optional
[
Union
[
np
.
ndarray
,
tf
.
Tensor
]]
=
None
,
use_cache
=
None
,
use_cache
:
Optional
[
bool
]
=
None
,
output_attentions
=
None
,
output_attentions
:
Optional
[
bool
]
=
None
,
output_hidden_states
=
None
,
output_hidden_states
:
Optional
[
bool
]
=
None
,
return_dict
=
None
,
return_dict
:
Optional
[
bool
]
=
None
,
labels
=
None
,
labels
:
Optional
[
tf
.
Tensor
]
=
None
,
training
=
False
,
training
:
bool
=
False
,
):
):
"""
"""
Returns:
Returns:
...
...
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