# tinker_cookbook.supervised.StreamingSupervisedDatasetFromHFDataset ## *class* [**tinker_cookbook.supervised.StreamingSupervisedDatasetFromHFDataset**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L137)(*[SupervisedDataset](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/superviseddataset/index.md)*) A supervised dataset that streams from HuggingFace, reducing memory usage. Only supports forward iteration; seeking backward raises an error. ### [**get_batch**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L175)(*index*) Return a batch of Datum objects at the given index. Only forward iteration is supported. Requesting a batch at or before the most recently returned index raises [`DataValidationError`](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/exceptions/datavalidationerror/index.md). **Parameters:** - [**index**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L175) (*int*) – Zero-based batch index (must be strictly greater than the previous call's index). **Returns:** *list\[tinker.[Datum](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/types/datum/index.md)\]* – Training datums for this batch. **Raises:** - DataValidationError: If `index` would require backward seeking. ### [**set_epoch**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L214)(*seed*) Reset the stream for a new epoch. **Parameters:** - [**seed**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/data.py#L214) (*int*) – Epoch seed forwarded to the underlying iterable dataset. Default `0`.