Upload load.py with huggingface_hub
Browse files
load.py
CHANGED
|
@@ -7,7 +7,9 @@ from .operator import StreamSource
|
|
| 7 |
|
| 8 |
|
| 9 |
def load_dataset(source: Union[StreamSource, str]) -> DatasetDict:
|
| 10 |
-
assert isinstance(
|
|
|
|
|
|
|
| 11 |
if isinstance(source, str):
|
| 12 |
source, _ = fetch_artifact(source)
|
| 13 |
return source().to_dataset()
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def load_dataset(source: Union[StreamSource, str]) -> DatasetDict:
|
| 10 |
+
assert isinstance(
|
| 11 |
+
source, (StreamSource, str)
|
| 12 |
+
), "source must be a StreamSource or a string"
|
| 13 |
if isinstance(source, str):
|
| 14 |
source, _ = fetch_artifact(source)
|
| 15 |
return source().to_dataset()
|