diff --git a/src/datasets/iterable_dataset.py b/src/datasets/iterable_dataset.py index a3b09561218..b1df83dfcf1 100644 --- a/src/datasets/iterable_dataset.py +++ b/src/datasets/iterable_dataset.py @@ -293,7 +293,7 @@ def wrapper(**kwargs): @dataclass -class ShuffingConfig: +class ShufflingConfig: seed: Optional[int] = None @@ -306,7 +306,7 @@ def __init__( info: Optional[DatasetInfo] = None, split: Optional[NamedSplit] = None, format_type: Optional[str] = None, - shuffling: Optional[ShuffingConfig] = None, + shuffling: Optional[ShufflingConfig] = None, ): info = info.copy() if info is not None else DatasetInfo() DatasetInfoMixin.__init__(self, info=info, split=split) @@ -425,7 +425,7 @@ def shuffle(self, buffer_size, seed=None) -> "IterableDataset": buffer_size (:obj:`int`): size of the buffer. seed (:obj:`int`, optional, default None): random seed that will be used to create the distribution. """ - shuffling = ShuffingConfig(seed=seed) + shuffling = ShufflingConfig(seed=seed) return iterable_dataset( ex_iterable=BufferShuffledExamplesIterable(self._ex_iterable, buffer_size, seed=seed).shuffle_data_sources( seed=seed @@ -477,7 +477,7 @@ def iterable_dataset( info: Optional[DatasetInfo] = None, split: Optional[NamedSplit] = None, format_type: Optional[str] = None, - shuffling: Optional[ShuffingConfig] = None, + shuffling: Optional[ShufflingConfig] = None, ): if format_type is not None and format_type == "torch": import torch diff --git a/tests/test_iterable_dataset.py b/tests/test_iterable_dataset.py index 14fe1147c4c..ee149b58ae1 100644 --- a/tests/test_iterable_dataset.py +++ b/tests/test_iterable_dataset.py @@ -13,7 +13,7 @@ IterableDataset, MappedExamplesIterable, RandomlyCyclingMultiSourcesExamplesIterable, - ShuffingConfig, + ShufflingConfig, SkipExamplesIterable, TakeExamplesIterable, _batch_to_examples, @@ -296,7 +296,7 @@ def test_iterable_dataset_shuffle(dataset: IterableDataset, generate_examples_fn buffer_size = 3 dataset._ex_iterable.kwargs["filepaths"] = ["0.txt", "1.txt"] dataset = dataset.shuffle(buffer_size, seed=seed) - assert isinstance(dataset._shuffling, ShuffingConfig) + assert isinstance(dataset._shuffling, ShufflingConfig) assert dataset._shuffling.seed == seed # Effective seed is sum of seed and epoch if epoch is None: