How to use a custom Callback with Trainer.from_argparse_args


I’d like specify a custom Callback while passing argparse parameters using Trainer.from_argparse_args
How to do that?

Question copied from a github issue
in case someone searches for a similar question.

from_argparse_args accepts kwargs that override the args in the Namespace.

args = parser.parse_args()
trainer = Trainer.from_argparse_args(args, callbacks=[CustomCallback()])