Skip to content

Commit

Permalink
some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deependujha committed Jul 12, 2024
1 parent b0251a3 commit 20ceb32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/litdata/streaming/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def load_state_dict(self, obj: Dict[str, Any]) -> None:
self._num_samples_yielded_combined = obj["num_samples_yielded"]

# Used to restart on the next DataLoader worker from the previous run.
self._latest_worker_idx = (obj["latest_worker_idx"] + 1) % (self.num_workers if self.num_workers > 0 else 1)
self._latest_worker_idx = obj["latest_worker_idx"] + 1
self._worker_idx_iter = iter(self._worker_idx)
for _ in range(self._latest_worker_idx):
next(self._worker_idx_iter)
Expand Down
2 changes: 0 additions & 2 deletions src/litdata/streaming/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ def load_state_dict(self, state_dict: Dict[str, Any]) -> None:
if state_dict:
# the state is restored within the workers
self._state_dict = state_dict
self.subsampled_files = state_dict["subsampled_files"]
self.region_of_interest = state_dict["region_of_interest"]

def _validate_state_dict(self) -> None:
assert self._state_dict
Expand Down

0 comments on commit 20ceb32

Please sign in to comment.