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
8be9cb0a
"git@developer.sourcefind.cn:modelzoo/cirideep_tensorflow.git" did not exist on "bf02ba36a925487e4554d23286ea0fad2210f97c"
Unverified
Commit
8be9cb0a
authored
Oct 26, 2020
by
Lysandre Debut
Committed by
GitHub
Oct 26, 2020
Browse files
Tiny TF Bart fixes (#8023)
parent
07747863
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/modeling_tf_bart.py
src/transformers/modeling_tf_bart.py
+3
-1
No files found.
src/transformers/modeling_tf_bart.py
View file @
8be9cb0a
...
@@ -822,7 +822,7 @@ class TFBartModel(TFPretrainedBartModel):
...
@@ -822,7 +822,7 @@ class TFBartModel(TFPretrainedBartModel):
if
decoder_attn_mask
is
None
:
if
decoder_attn_mask
is
None
:
decoder_padding_mask
=
make_padding_mask
(
decoder_input_ids
,
pad_token_id
)
decoder_padding_mask
=
make_padding_mask
(
decoder_input_ids
,
pad_token_id
)
else
:
else
:
decoder_padding_mask
=
invert_mask
(
tf
.
Tensor
)
decoder_padding_mask
=
invert_mask
(
decoder_attn_mask
)
causal_lm_mask
=
causal_attention_mask
(
tgt_len
,
tgt_len
,
mask_dtype
)
causal_lm_mask
=
causal_attention_mask
(
tgt_len
,
tgt_len
,
mask_dtype
)
return
decoder_input_ids
,
decoder_padding_mask
,
causal_lm_mask
return
decoder_input_ids
,
decoder_padding_mask
,
causal_lm_mask
...
@@ -903,6 +903,7 @@ class TFBartModel(TFPretrainedBartModel):
...
@@ -903,6 +903,7 @@ class TFBartModel(TFPretrainedBartModel):
output_attentions
=
output_attentions
,
output_attentions
=
output_attentions
,
output_hidden_states
=
output_hidden_states
,
output_hidden_states
=
output_hidden_states
,
return_dict
=
True
,
return_dict
=
True
,
training
=
training
,
)
)
decoder_outputs
=
self
.
decoder
(
decoder_outputs
=
self
.
decoder
(
decoder_input_ids
,
decoder_input_ids
,
...
@@ -915,6 +916,7 @@ class TFBartModel(TFPretrainedBartModel):
...
@@ -915,6 +916,7 @@ class TFBartModel(TFPretrainedBartModel):
output_attentions
=
output_attentions
,
output_attentions
=
output_attentions
,
output_hidden_states
=
output_hidden_states
,
output_hidden_states
=
output_hidden_states
,
return_dict
=
return_dict
,
return_dict
=
return_dict
,
training
=
training
,
)
)
if
not
return_dict
:
if
not
return_dict
:
# Attention and hidden_states will be [] or None if they aren't needed
# Attention and hidden_states will be [] or None if they aren't needed
...
...
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