From 499e85c7b52c8865fb8921dcd5bcb97c936a2eea Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Thu, 7 Mar 2024 11:20:51 +0400 Subject: [PATCH] fix: getting empty chunks in semantic splitter --- service/splitter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/splitter.py b/service/splitter.py index b4a9237d..2443619f 100644 --- a/service/splitter.py +++ b/service/splitter.py @@ -188,6 +188,8 @@ def _append_chunks( # TODO: Think of how to pass this to LLM metadata={"table_content": table, **metadata}, ) + else: + accumulated_element_texts.append(element.get("text")) # Process any remaining accumulated text after the last table # or if no table was encountered