Skip to content

Commit

Permalink
Confirm that the provided Dataset is in the DatasetDict format from HF
Browse files Browse the repository at this point in the history
  • Loading branch information
gubertoli authored Apr 4, 2024
1 parent 1fdc09f commit ba0cf03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion datasets/flwr_datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ def _instantiate_resplitter_if_needed(
return cast(Optional[Resplitter], resplitter)


def _check_if_dataset_tested(dataset: Union[str, Dataset]):
def _check_if_dataset_tested(dataset: Union[str, DatasetDict]) -> None:
"""Check if the dataset is in the narrowed down list of the tested datasets."""
if dataset not in tested_datasets and type(dataset) is str:
warnings.warn(
f"The currently tested dataset are {tested_datasets}. Given: {dataset}.",
stacklevel=1,
)
if type(dataset) is not DatasetDict:
warnings.warn(
f"The provided dataset is not in the DatasetDict format.",
stacklevel=1,
)


def divide_dataset(
Expand Down

0 comments on commit ba0cf03

Please sign in to comment.