Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pipelines/incremental-pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def chunk_and_embed_incremental(
# Split into chunks
chunks = text_splitter.split_text(content)

# Guard: skip files that produce no chunks after splitting to
# avoid ZeroDivisionError in the log statement below.
# Same fix as kubeflow-pipeline.py (PR #149, issue #148).
if not chunks:
print(f"Skipping file after chunking (no chunks produced): {file_data['path']}")
continue

print(f"File: {file_data['path']} -> {len(chunks)} chunks (avg: {sum(len(c) for c in chunks)/len(chunks):.0f} chars)")

# Create embeddings
Expand Down