Skip to content

Commit

Permalink
Pass dataset to dry_run method (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
plaguss authored Aug 8, 2024
1 parent 2ded30f commit 314b759
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/distilabel/pipeline/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def dry_run(
self,
parameters: Optional[Dict[str, Dict[str, Any]]] = None,
batch_size: int = 1,
dataset: Optional["InputDataset"] = None,
) -> "Distiset":
"""Do a dry run to test the pipeline runs as expected.
Expand All @@ -412,6 +413,9 @@ def dry_run(
the runtime parameters for the step as the value. Defaults to `None`.
batch_size: The batch size of the unique batch generated by the generators
steps of the pipeline. Defaults to `1`.
dataset: If given, it will be used to create a `GeneratorStep` and put it as the
root step. Convenient method when you have already processed the dataset in
your script and just want to pass it already processed. Defaults to `None`.
Returns:
Will return the `Distiset` as the main run method would do.
Expand All @@ -426,7 +430,7 @@ def dry_run(
parameters = {}
parameters[step_name] = {"batch_size": batch_size}

distiset = self.run(parameters=parameters, use_cache=False)
distiset = self.run(parameters=parameters, use_cache=False, dataset=dataset)

self._dry_run = False
return distiset
Expand Down

0 comments on commit 314b759

Please sign in to comment.