Spaces:
Runtime error
Runtime error
fixing no chunking error handling
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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.")
|