# Loading local model checkpoint default behavior

**URL:** <https://discuss.huggingface.co/t/loading-local-model-checkpoint-default-behavior/100057>\
**Category:** Beginners\
**Created:** [July 30, 2024, 9:20am UTC](https://discuss.huggingface.co/t/loading-local-model-checkpoint-default-behavior/100057 "2024-07-30T09:20:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben-pfirsich](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@ben-pfirsich](https://discuss.huggingface.co/u/ben-pfirsich)\
**Post date:** [July 30, 2024, 9:20am UTC](https://discuss.huggingface.co/t/loading-local-model-checkpoint-default-behavior/100057/1 "2024-07-30T09:20:33Z")

</div>

I have been trying to find out how the `AutoModelForCausalLM.from_pretrained` method decides which checkpoint to load when only the directory of the trained model is specified.

More specifically, I trained a model and have three checkpoint saved locally (one for each training epoch). When I only specify the the parent directory in the `from_pretrained` method, some model is loaded but I do not know which one.

---

<div class="post-metadata">

**Author:** ![ben-pfirsich](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@ben-pfirsich](https://discuss.huggingface.co/u/ben-pfirsich)\
**Post date:** [July 30, 2024, 10:52am UTC](https://discuss.huggingface.co/t/loading-local-model-checkpoint-default-behavior/100057/2 "2024-07-30T10:52:19Z")

</div>

I think this was just my mistake. I had a call to `trainer.model.save_pretrained(f"{OUTPUT_DIR}/{save_path}")` at the very end of my script. So i guess the final model was saved in the base directory and should be equal to the last epoch.
