From 974b45e951847596208b8e0e34395dbdde19460e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Mart=C3=ADn=20Bl=C3=A1zquez?= Date: Mon, 29 Jul 2024 16:37:34 +0200 Subject: [PATCH] Do not take into account `disable_cuda_device_placement` for pipeline signature (#838) * Do not take into account `disable_cuda_device_placement` for pipeline signature * Fix unit test --- src/distilabel/pipeline/base.py | 6 +++++- tests/unit/pipeline/test_base.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/distilabel/pipeline/base.py b/src/distilabel/pipeline/base.py index 0bf8463255..42a8f871e2 100644 --- a/src/distilabel/pipeline/base.py +++ b/src/distilabel/pipeline/base.py @@ -254,7 +254,11 @@ def _create_signature(self) -> str: if isinstance(value, dict): # input_mappings/output_mappings step_info += "-".join( - [f"{str(k)}-{str(v)}" for k, v in value.items()] + [ + f"{str(k)}={str(v)}" + for k, v in value.items() + if k not in ("disable_cuda_device_placement",) + ] ) elif isinstance(value, (list, tuple)): # runtime_parameters_info diff --git a/tests/unit/pipeline/test_base.py b/tests/unit/pipeline/test_base.py index cec1e54ee5..edd79d2efb 100644 --- a/tests/unit/pipeline/test_base.py +++ b/tests/unit/pipeline/test_base.py @@ -1290,7 +1290,7 @@ def test_base_pipeline_signature(self) -> None: ) signature = pipeline._create_signature() - assert signature == "f291da215cd42085c538e4897e4355f614932547" + assert signature == "d3c7c572fe31233aa1198174c6c793b67ef3744b" def test_binary_rshift_operator(self) -> None: # Tests the steps can be connected using the >> operator.