# Save only best model in Trainer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsave-only-best-model-in-trainer%2F8442%3E%5C
**Category:** 🤗Transformers\
**Created:** [July 17, 2021, 6:25am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsave-only-best-model-in-trainer%2F8442 "2021-07-17T06:25:08Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [July 19, 2021, 9:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsave-only-best-model-in-trainer%2F8442%2F5 "2021-07-19T09:21:32Z")

</div>

You can’t use `load_best_model_at_end=True` if you don’t want to save checkpoints: it needs to save checkpoints at every evaluation to make sure you have the best model, and it will always save 2 checkpoints (even if `save_total_limit` is 1): the best one and the last one (to resume an interrupted training).

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsave-only-best-model-in-trainer%2F8442)._
