"docs/source/vscode:/vscode.git/clone" did not exist on "2ef09ecfb8afb6624aab87afdad9fe72030397af"
Unverified Commit 79c57e1a authored by Matt's avatar Matt Committed by GitHub
Browse files

Deprecate TFTrainer (#12706)

* Deprecate TFTrainer

* Style pass
parent 084873b0
...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment