Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass dataset to dry_run method #863

Merged
merged 1 commit into from
Aug 8, 2024
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: 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
Loading