Skip to content

Commit

Permalink
fix: files from datasets should also be streamed in chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlbauer committed Jan 24, 2025
1 parent 08eeb02 commit c034c66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rocrate/model/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ def _stream_folder_from_path(self) -> Generator[tuple[str, bytes], None, None]:
root = Path(root)
for name in files:
source = root / name
dest = source.relative_to(self.source.parent)
dest = source.relative_to(Path(self.source).parent)
with open(source, 'rb') as f:
yield str(dest), f.read()
for chunk in f:
yield str(dest), chunk

def _stream_folder_from_url(self) -> Generator[tuple[str, bytes], None, None]:
if not self.fetch_remote:
Expand Down

0 comments on commit c034c66

Please sign in to comment.