David0dods commited on
Commit
2a3a7dc
·
verified ·
1 Parent(s): 2e79f5d

fixing no chunking error handling

Browse files
Files changed (1) hide show
  1. src/ingestion/build_index.py +4 -1
src/ingestion/build_index.py CHANGED
@@ -92,7 +92,10 @@ def build_index(source_dir: str, project_id: str):
92
  )
93
 
94
  print("Adding chunks to Chroma DB...")
95
- vectorstore.add_documents(chunks)
 
 
 
96
 
97
  save_manifest(manifest, manifest_path)
98
  print("Ingestion complete. Manifest updated.")
 
92
  )
93
 
94
  print("Adding chunks to Chroma DB...")
95
+ if len(chunks) > 0:
96
+ vectorstore.add_documents(chunks)
97
+ else:
98
+ print("No readable text chunks found in this document.")
99
 
100
  save_manifest(manifest, manifest_path)
101
  print("Ingestion complete. Manifest updated.")