Clarification on push_to_hub, best model, and model card

Hi,

I’m trying to solve a doubt that I saw a few other people have asked about, but couldn’t find an answer.

The question is quite simple: when using trainer.push_to_hub() together with the load_best_model_at_end argument, is the trainer pushing the last or the best model?

My doubt is raised by the fact that the automatically-created model card reports the selected score metric for the last epoch, instead of the one obtained at the best one.

I am reasonably sure is not an issue of loading the best model, since I’ve tested via trainer.evaluate() that after training the trainer is, in fact using the best-obtained model.

Thank you so very much for any help/clarification, and the great work you’re all doing!