Upload stream.py with huggingface_hub
Browse files
stream.py
CHANGED
|
@@ -23,7 +23,7 @@ class Stream(Dataclass):
|
|
| 23 |
caching: bool = False
|
| 24 |
copying: bool = False
|
| 25 |
|
| 26 |
-
def
|
| 27 |
"""Private method to get the correct initiator based on the streaming and caching attributes.
|
| 28 |
|
| 29 |
Returns:
|
|
@@ -43,7 +43,7 @@ class Stream(Dataclass):
|
|
| 43 |
Returns:
|
| 44 |
object: The stream object.
|
| 45 |
"""
|
| 46 |
-
return self.
|
| 47 |
|
| 48 |
def __iter__(self):
|
| 49 |
return iter(self._get_stream())
|
|
|
|
| 23 |
caching: bool = False
|
| 24 |
copying: bool = False
|
| 25 |
|
| 26 |
+
def _get_initiator(self):
|
| 27 |
"""Private method to get the correct initiator based on the streaming and caching attributes.
|
| 28 |
|
| 29 |
Returns:
|
|
|
|
| 43 |
Returns:
|
| 44 |
object: The stream object.
|
| 45 |
"""
|
| 46 |
+
return self._get_initiator()(self.generator, gen_kwargs=self.gen_kwargs)
|
| 47 |
|
| 48 |
def __iter__(self):
|
| 49 |
return iter(self._get_stream())
|