diff --git a/backend/danswer/indexing/chunker.py b/backend/danswer/indexing/chunker.py index 9d27885d3338..1166c93ffbd4 100644 --- a/backend/danswer/indexing/chunker.py +++ b/backend/danswer/indexing/chunker.py @@ -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,