# How to customize dataloader creation in trainer?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-customize-dataloader-creation-in-trainer%2F8681%3E%5C
**Category:** 🤗Transformers\
**Created:** [July 26, 2021, 5:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-customize-dataloader-creation-in-trainer%2F8681 "2021-07-26T05:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZW1](https://avatars.discourse-cdn.com/v4/letter/z/e495f1/32.png) [@ZW1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FZW1)%5C
**Post date:** [July 26, 2021, 5:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-customize-dataloader-creation-in-trainer%2F8681%2F1 "2021-07-26T05:40:00Z")

</div>

Is there a way I could re-create the dataloader after each epoch through a custom function when using trainer?

---

<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 26, 2021, 1:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-customize-dataloader-creation-in-trainer%2F8681%2F2 "2021-07-26T13:12:12Z")

</div>

No, you should probably use a manual training loop for that, using the Accelerate library.
