Skip to content

Commit 2de90be

Browse files
Super-small fix stops us confusing Keras console logging by modifying its logs (huggingface#15373)
1 parent fa6dce2 commit 2de90be

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transformers/keras_callbacks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def on_train_batch_end(self, batch, logs=None):
324324
)
325325

326326
def on_epoch_end(self, epoch, logs=None):
327+
logs = logs.copy() # Don't accidentally write things that Keras will read later
327328
if "epoch" not in logs:
328329
logs["epoch"] = epoch
329330
self.training_history.append(logs)

0 commit comments

Comments
 (0)