# Streaming Dataset of Sequence Length 2048

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstreaming-dataset-of-sequence-length-2048%2F17649%3E%5C
**Category:** Intermediate\
**Created:** [May 7, 2022, 8:00pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstreaming-dataset-of-sequence-length-2048%2F17649 "2022-05-07T20:00:17Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![loubnabnl](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/loubnabnl/32/21016_2.png) [@loubnabnl](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Floubnabnl)%5C
**Post date:** [May 12, 2022, 4:40pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstreaming-dataset-of-sequence-length-2048%2F17649%2F7 "2022-05-12T16:40:20Z")

</div>

- When training a model on the `lvwerra/codeparrot-clean-train` dataset, we don’t get these spikes even without shuffling the sequences inside the batches but we’re using a different training setting that is supposed to be more stable and implements some of the ideas you mentioned, you can find the code here [transformers/codeparrot\_training.py at main · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/blob/main/examples/research_projects/codeparrot/scripts/codeparrot_training.py) . We also use file concatenation and sequence splitting without padding.
- As for the shuffling of a torch IterableDataset, you can create a ShuffledDataset class to which you pass your IterableDataset like here [How to shuffle an iterable dataset - #6 by sharvil - PyTorch Forums](https://discuss.pytorch.org/t/how-to-shuffle-an-iterable-dataset/64130/6) Or use `combinatorics.ShufflerIterDataPipe(IterableDataset, buffer_size)` from `torch.utils.data.datapipes.iter` which I think is supposed to do the same thing

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstreaming-dataset-of-sequence-length-2048%2F17649)._
