# BatchSampler - with trainer

**URL:** <https://discuss.huggingface.co/t/batchsampler-with-trainer/47470>\
**Category:** Beginners\
**Created:** [July 20, 2023, 11:16am UTC](https://discuss.huggingface.co/t/batchsampler-with-trainer/47470 "2023-07-20T11:16:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul1020](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Paul1020](https://discuss.huggingface.co/u/Paul1020)\
**Post date:** [July 20, 2023, 11:16am UTC](https://discuss.huggingface.co/t/batchsampler-with-trainer/47470/1 "2023-07-20T11:16:16Z")

</div>

I am trying to use Transformers Trainer and I want to generate batches and not single items.

I need that in order to generate batches of different sizes without doing padding.  
Is that possible to do with the implemented trainer ?
