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
5feac3d0
Unverified
Commit
5feac3d0
authored
Jun 29, 2022
by
Matt
Committed by
GitHub
Jun 29, 2022
Browse files
Fix prepare_tf_dataset when drop_remainder is not supplied (#17950)
parent
bc019b0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/modeling_tf_utils.py
src/transformers/modeling_tf_utils.py
+3
-0
No files found.
src/transformers/modeling_tf_utils.py
View file @
5feac3d0
...
...
@@ -1215,6 +1215,9 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin, TFGenerationMixin, Pu
output_columns
=
list
(
output_signature
.
keys
())
feature_cols
=
[
col
for
col
in
output_columns
if
col
in
model_inputs
and
col
not
in
model_labels
]
label_cols
=
[
col
for
col
in
output_columns
if
col
in
model_labels
]
if
drop_remainder
is
None
:
drop_remainder
=
shuffle
tf_dataset
=
dataset
.
to_tf_dataset
(
columns
=
feature_cols
,
label_cols
=
label_cols
,
...
...
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