Elron commited on
Commit
a4795aa
1 Parent(s): e170c35

Upload api.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. api.py +4 -4
api.py CHANGED
@@ -6,15 +6,15 @@ from .artifact import fetch_artifact
6
  from .dataset_utils import get_dataset_artifact
7
  from .logging_utils import get_logger
8
  from .metric_utils import _compute
9
- from .operator import StreamSource
10
 
11
  logger = get_logger()
12
 
13
 
14
- def load(source: Union[StreamSource, str]) -> DatasetDict:
15
  assert isinstance(
16
- source, (StreamSource, str)
17
- ), "source must be a StreamSource or a string"
18
  if isinstance(source, str):
19
  source, _ = fetch_artifact(source)
20
  return source().to_dataset()
 
6
  from .dataset_utils import get_dataset_artifact
7
  from .logging_utils import get_logger
8
  from .metric_utils import _compute
9
+ from .operator import SourceOperator
10
 
11
  logger = get_logger()
12
 
13
 
14
+ def load(source: Union[SourceOperator, str]) -> DatasetDict:
15
  assert isinstance(
16
+ source, (SourceOperator, str)
17
+ ), "source must be a SourceOperator or a string"
18
  if isinstance(source, str):
19
  source, _ = fetch_artifact(source)
20
  return source().to_dataset()