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
79c57e1a
Unverified
Commit
79c57e1a
authored
Jul 14, 2021
by
Matt
Committed by
GitHub
Jul 14, 2021
Browse files
Deprecate TFTrainer (#12706)
* Deprecate TFTrainer * Style pass
parent
084873b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/transformers/trainer_tf.py
src/transformers/trainer_tf.py
+9
-0
No files found.
src/transformers/trainer_tf.py
View file @
79c57e1a
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
import
datetime
import
datetime
import
math
import
math
import
os
import
os
import
warnings
from
typing
import
Callable
,
Dict
,
Optional
,
Tuple
from
typing
import
Callable
,
Dict
,
Optional
,
Tuple
from
.file_utils
import
ENV_VARS_TRUE_VALUES
from
.file_utils
import
ENV_VARS_TRUE_VALUES
...
@@ -105,6 +106,14 @@ class TFTrainer:
...
@@ -105,6 +106,14 @@ class TFTrainer:
self
.
epoch_logging
=
0
self
.
epoch_logging
=
0
self
.
eval_loss
=
tf
.
keras
.
metrics
.
Sum
()
self
.
eval_loss
=
tf
.
keras
.
metrics
.
Sum
()
warnings
.
warn
(
"The class `TFTrainer` is deprecated and will be removed in version 5 of Transformers. "
"We recommend using native Keras instead, by calling methods like `fit()` and `predict()` "
"directly on the model object. Detailed examples of the Keras style can be found in our "
"examples at https://github.com/huggingface/transformers/tree/master/examples/tensorflow"
,
FutureWarning
,
)
if
tb_writer
is
not
None
:
if
tb_writer
is
not
None
:
self
.
tb_writer
=
tb_writer
self
.
tb_writer
=
tb_writer
else
:
else
:
...
...
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