Log losses/metrics with CustomTrainer(Trainer) class in the same frequency as Trainer, with wandb

Adding callbacks are probably the cleanest method. Implementing it in other ways may cause problems if the library version is updated and the behavior changes.:sweat_smile:

from transformers import TrainerCallback

class MyLogger(TrainerCallback):
    def __init__(self):
...
    def on_log(self, args, state, control, logs=None, **kwargs):
...

trainer = CustomTrainer(
    ...,
    callbacks=[MyLogger()],
)