Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/guidellm/data/deserializers/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def features(self) -> Features:
def num_shards(self) -> int:
return 1

@property
def n_shards(self) -> int:
"""Alias for num_shards; required by HuggingFace datasets IterableDataset API."""
return self.num_shards

def shuffle_data_sources(
self,
generator: np.random.Generator, # noqa: ARG002
Expand All @@ -114,11 +119,10 @@ def shuffle_data_sources(

def shard_data_sources(
self,
num_shards: int, # noqa: ARG002
index: int, # noqa: ARG002
contiguous: bool = True, # noqa: ARG002
worker_id: int, # noqa: ARG002
num_workers: int, # noqa: ARG002
) -> _SyntheticTextExamplesIterable:
"""Return self since synthetic data generation is infinite and stateless."""
"""HuggingFace API: return self since synthetic data is infinite and stateless."""
return self

def load_state_dict(self, state_dict: dict) -> None:
Expand Down
Loading