# Use Trainer with2 optimizers?

**URL:** <https://discuss.huggingface.co/t/use-trainer-with2-optimizers/98025>\
**Category:** Intermediate\
**Created:** [July 17, 2024, 9:38pm UTC](https://discuss.huggingface.co/t/use-trainer-with2-optimizers/98025 "2024-07-17T21:38:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sannndy](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sannndy](https://discuss.huggingface.co/u/Sannndy)\
**Post date:** [July 17, 2024, 9:38pm UTC](https://discuss.huggingface.co/t/use-trainer-with2-optimizers/98025/1 "2024-07-17T21:38:29Z")

</div>

Hi,

My model training involves iteratively optimize two parts of the model. It seems the Trainer only takes in one optimizer though. What’s the best way to approach this?

Thanks!
