Skip to content

Commit

Permalink
Fix indexing of whitespace only
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Jan 6, 2024
1 parent 6b6b3da commit 3098365
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/danswer/indexing/chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

1 comment on commit 3098365

@vercel
Copy link

@vercel vercel bot commented on 3098365 Jan 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.