From 0240ae293066141b90cf9d7083d4bf3d1ada0ec0 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Tue, 3 Dec 2024 13:58:27 +0100 Subject: [PATCH] Pass nested clusters through GLM as payload Signed-off-by: Christoph Auer Signed-off-by: Christoph Auer --- docling/models/ds_glm_model.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docling/models/ds_glm_model.py b/docling/models/ds_glm_model.py index c17f0b17..3ba54b86 100644 --- a/docling/models/ds_glm_model.py +++ b/docling/models/ds_glm_model.py @@ -215,17 +215,21 @@ class GlmModel: ) ], obj_type=layout_label_to_ds_type.get(element.label), - payload=TypeAdapter(List[Cluster]).dump_python( - element.cluster.children - ), # hack to channel child clusters through GLM + payload={ + "children": TypeAdapter(List[Cluster]).dump_python( + element.cluster.children + ) + }, # hack to channel child clusters through GLM ) ) elif isinstance(element, ContainerElement): main_text.append( BaseText( - payload=TypeAdapter(List[Cluster]).dump_python( - element.cluster.children - ), # hack to channel child clusters through GLM + payload={ + "children": TypeAdapter(List[Cluster]).dump_python( + element.cluster.children + ) + }, # hack to channel child clusters through GLM obj_type=layout_label_to_ds_type.get(element.label), name=element.label, prov=[