-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add utils.hydra.resolve_target() * implement DatasetDict * add documentation to methods * rename from_hf_dataset to from_hf and allow HF Dataset or HF IterableDataset as input * improve documentation * fix tests
- Loading branch information
1 parent
3dcbb4c
commit ca80fe8
Showing
9 changed files
with
1,129 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Optional, Union | ||
|
||
from .dataset import Dataset, IterableDataset | ||
|
||
|
||
class EnterDatasetMixin(ABC): | ||
"""Mixin for processors that enter a dataset context.""" | ||
|
||
@abstractmethod | ||
def enter_dataset( | ||
self, dataset: Union[Dataset, IterableDataset], name: Optional[str] = None | ||
) -> None: | ||
"""Enter dataset context.""" | ||
|
||
|
||
class ExitDatasetMixin(ABC): | ||
"""Mixin for processors that exit a dataset context.""" | ||
|
||
@abstractmethod | ||
def exit_dataset( | ||
self, dataset: Union[Dataset, IterableDataset], name: Optional[str] = None | ||
) -> None: | ||
"""Exit dataset context.""" | ||
|
||
|
||
class EnterDatasetDictMixin(ABC): | ||
"""Mixin for processors that enter a dataset dict context.""" | ||
|
||
@abstractmethod | ||
def enter_dataset_dict(self, dataset_dict) -> None: | ||
"""Enter dataset dict context.""" | ||
|
||
|
||
class ExitDatasetDictMixin(ABC): | ||
"""Mixin for processors that exit a dataset dict context.""" | ||
|
||
@abstractmethod | ||
def exit_dataset_dict(self, dataset_dict) -> None: | ||
"""Exit dataset dict context.""" |
Oops, something went wrong.