From 4c6d8f3b6774e89709cc8b09e0a85e3240791a6c Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Tue, 20 Aug 2024 17:31:01 +0200 Subject: [PATCH] Fix deserialization --- src/hayhooks/server/pipelines/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hayhooks/server/pipelines/models.py b/src/hayhooks/server/pipelines/models.py index 35de7f7..51d37ad 100644 --- a/src/hayhooks/server/pipelines/models.py +++ b/src/hayhooks/server/pipelines/models.py @@ -76,7 +76,12 @@ def convert_component_output(component_output): for output_name, data in component_output.items(): def get_value(data): - return data.to_dict()["init_parameters"] if hasattr(data, "to_dict") else data + if hasattr(data, "to_dict") and "init_parameters" in data.to_dict(): + return data.to_dict()["init_parameters"] + elif hasattr(data, "to_dict"): + return data.to_dict() + else: + return data if type(data) is list: result[output_name] = [get_value(d) for d in data]