Skip to content

Commit

Permalink
fix: overwrite to free previous chunk from the memory
Browse files Browse the repository at this point in the history
Co-authored-by: thomas chaton <[email protected]>
  • Loading branch information
bhimrazy and tchaton authored Jul 17, 2024
1 parent ac2a9e5 commit 9db4773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/litdata/streaming/item_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def _load_encrypted_data(
else:
encrypted_data = fp.read()
decrypted_data = encryption.decrypt(encrypted_data) # type: ignore
self._decrypted_chunks[chunk_index] = decrypted_data
# This would enable us to free the previous chunk from the memory.
self._decrypted_chunks = {chunk_index: decrypted_data}
fp = BytesIO(decrypted_data)

data = self._load_data(fp, offset)
Expand Down

0 comments on commit 9db4773

Please sign in to comment.