Fix indexing of whitespace only

This commit is contained in:
Weves
2024-01-05 19:28:26 -08:00
committed by Chris Weaver
parent 6b6b3daab7
commit 30983657ec

View File

@@ -137,7 +137,8 @@ def chunk_document(
chunk_text = section_text
# Once we hit the end, if we're still in the process of building a chunk, add what we have
if chunk_text:
# NOTE: if it's just whitespace, ignore it.
if chunk_text.strip():
chunks.append(
DocAwareChunk(
source_document=document,