How to set early stopping when running

Same with the topic. I know how to change the training epochs buut I don’t know how to add early stopping when running

Hi, I’m having a similar issue. I’m trying to set an EarlyStoppingCallback in the parameters setting the following flag:

--callbacks [EarlyStoppingCallback(early_stopping_patience=3)]

When doing this bash complains about the '('. I have tried to use a more bash-friendly syntax adding \ before the parentheses but it says that that it is not used in the HfArgumentParser.

Have you figured out how to set it?

Thank you very much!!

You can’t pass callbacks directly callbacks form the CLI. You have to add them in the example script, for instance with trainer.add_callback(my_callback).

Thank you very much!!