Stop requiring Torch for our TF examples! (#21997)

* Stop requiring Torch for our TF examples!

* Slight tweak to logging in the example itself
This commit is contained in:
Matt
2023-03-07 15:54:10 +00:00
committed by GitHub
parent 7c39318136
commit d128f2ffab
2 changed files with 9 additions and 3 deletions

View File

@@ -273,7 +273,6 @@ def main():
handlers=[logging.StreamHandler(sys.stdout)],
)
if training_args.should_log:
# The default of training_args.log_level is passive, so we set log level at info here to have that default.
transformers.utils.logging.set_verbosity_info()

View File

@@ -249,6 +249,13 @@ class TFTrainingArguments(TrainingArguments):
requires_backends(self, ["tf"])
return self._setup_strategy.num_replicas_in_sync
@property
def should_log(self):
"""
Whether or not the current process should produce log.
"""
return False # TF Logging is handled by Keras not the Trainer
@property
def train_batch_size(self) -> int:
"""