Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/litdata/streaming/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def download_chunk_from_index(self, chunk_index: int) -> None:
return

if self._downloader is None:
raise RuntimeError("The downloader should be defined.")
return

self._downloader.download_chunk_from_index(chunk_index)

Expand All @@ -101,7 +101,9 @@ def try_decompress(self, local_chunkpath: str) -> None:
with open(local_chunkpath, "rb") as f:
data = f.read()

os.remove(local_chunkpath)
# delete the files only if they were downloaded
if self._downloader is not None:
os.remove(local_chunkpath)

data = self._compressor.decompress(data)

Expand Down