diff --git a/neptune/experiments.py b/neptune/experiments.py index 96956b35c..99f9f1ecf 100644 --- a/neptune/experiments.py +++ b/neptune/experiments.py @@ -580,7 +580,11 @@ def log_artifact(self, artifact, destination=None): If ``None`` is passed, an artifact file name will be used. Note: - If you provide `io.StringIO`, it will be encoded in 'utf-8' before sent to Neptune. + If you use in-memory buffers like `io.StringIO` or `io.BytesIO`, remember that in typical case when you + write to such a buffer, it's current position is set to the end of the stream, so in order to read it's + content, you need to move back it's position to the beginning. + We recommend to call seek(0) on the in-memory buffers before passing it to Neptune. + Additionally, if you provide `io.StringIO`, it will be encoded in 'utf-8' before sent to Neptune. Raises: `FileNotFound`: When ``artifact`` file was not found. diff --git a/neptune/internal/storage/datastream.py b/neptune/internal/storage/datastream.py index 9fdd5833c..45c430cf8 100644 --- a/neptune/internal/storage/datastream.py +++ b/neptune/internal/storage/datastream.py @@ -77,7 +77,7 @@ def generate(self, chunk_size=BYTES_IN_ONE_MB): last_offset = new_offset else: if last_offset == 0: - yield FileChunk(chunk, 0, 0) + yield FileChunk(b'', 0, 0) break def close(self):