# Difference between using the Trainer class vs Accelerate library

**URL:** <https://discuss.huggingface.co/t/difference-between-using-the-trainer-class-vs-accelerate-library/44703>\
**Category:** DeepSpeed\
**Created:** [June 27, 2023, 8:01am UTC](https://discuss.huggingface.co/t/difference-between-using-the-trainer-class-vs-accelerate-library/44703 "2023-06-27T08:01:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SantoshScienceIO](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@SantoshScienceIO](https://discuss.huggingface.co/u/SantoshScienceIO)\
**Post date:** [June 27, 2023, 8:01am UTC](https://discuss.huggingface.co/t/difference-between-using-the-trainer-class-vs-accelerate-library/44703/1 "2023-06-27T08:01:52Z")

</div>

From this comment in 2021, it seems that accelerate is for those who don’t want to use the trainer and instead write their own loop

> <https://github.com/huggingface/accelerate/issues/214#issuecomment-997933171>
>
> huggingface transformer support deepspeed (https://huggingface.co/docs/transform…ers/main\_classes/deepspeed )
> 
> accelerate also support deepspeed via ds-plugin, so what is design thoughts besides no trainer flexibility?

Is that the only difference?
