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
9a2dabae
Unverified
Commit
9a2dabae
authored
Jan 17, 2022
by
Matt
Committed by
GitHub
Jan 17, 2022
Browse files
Fix dtype issue in TF BART (#15178)
parent
0167edc8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/bart/modeling_tf_bart.py
src/transformers/models/bart/modeling_tf_bart.py
+1
-1
No files found.
src/transformers/models/bart/modeling_tf_bart.py
View file @
9a2dabae
...
@@ -1383,7 +1383,7 @@ class TFBartForConditionalGeneration(TFBartPretrainedModel, TFCausalLanguageMode
...
@@ -1383,7 +1383,7 @@ class TFBartForConditionalGeneration(TFBartPretrainedModel, TFCausalLanguageMode
if
inputs
[
"labels"
]
is
not
None
:
if
inputs
[
"labels"
]
is
not
None
:
inputs
[
"labels"
]
=
tf
.
where
(
inputs
[
"labels"
]
=
tf
.
where
(
inputs
[
"labels"
]
==
self
.
config
.
pad_token_id
,
inputs
[
"labels"
]
==
self
.
config
.
pad_token_id
,
tf
.
fill
(
shape_list
(
inputs
[
"labels"
]),
-
100
),
tf
.
cast
(
tf
.
fill
(
shape_list
(
inputs
[
"labels"
]),
-
100
),
inputs
[
"labels"
].
dtype
),
inputs
[
"labels"
],
inputs
[
"labels"
],
)
)
inputs
[
"use_cache"
]
=
False
inputs
[
"use_cache"
]
=
False
...
...
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