Skip to content

Commit

Permalink
Make input dir in DataProcessor required (#18910)
Browse files Browse the repository at this point in the history
(cherry picked from commit 61a286d)
  • Loading branch information
awaelchli authored and Borda committed Dec 19, 2023
1 parent 285e784 commit 7eabb21
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lightning/data/streaming/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def prepare_item(self, output_dir: str, item_metadata: T) -> None: # type: igno
class DataProcessor:
def __init__(
self,
input_dir: Optional[Union[str, Dir]] = None,
input_dir: Union[str, Dir],
output_dir: Optional[Union[str, Dir]] = None,
num_workers: Optional[int] = None,
num_downloaders: Optional[int] = None,
Expand Down Expand Up @@ -771,9 +771,8 @@ def __init__(
self.stop_queues: List[Queue] = []
self.reorder_files = reorder_files

if self.input_dir:
# Ensure the input dir is the same across all nodes
self.input_dir = self._broadcast_object(self.input_dir)
# Ensure the input dir is the same across all nodes
self.input_dir = self._broadcast_object(self.input_dir)

if self.output_dir:
# Ensure the output dir is the same across all nodes
Expand Down

0 comments on commit 7eabb21

Please sign in to comment.