Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files- src/app.py +10 -8
src/app.py
CHANGED
|
@@ -336,25 +336,27 @@ with tab2:
|
|
| 336 |
with col_a:
|
| 337 |
chunk_strategy = st.selectbox(
|
| 338 |
"Chunking Strategy",
|
| 339 |
-
["paragraph", "token",
|
| 340 |
-
help="Paragraph: Standard. Token: Dense text.
|
| 341 |
key="chunk_selector"
|
| 342 |
)
|
| 343 |
|
| 344 |
if st.button("📥 Add to Knowledge Base", type="primary"):
|
| 345 |
with st.spinner("Ingesting..."):
|
| 346 |
-
#
|
| 347 |
-
|
| 348 |
|
| 349 |
-
ok, msg = rag_engine.
|
| 350 |
-
temp_path,
|
| 351 |
-
|
|
|
|
| 352 |
)
|
| 353 |
|
| 354 |
if ok:
|
| 355 |
tracker.upload_user_db(st.session_state.username) # Auto-Sync
|
| 356 |
st.success(msg)
|
| 357 |
-
else:
|
|
|
|
| 358 |
|
| 359 |
# 2. SUMMARIZE
|
| 360 |
with col_b:
|
|
|
|
| 336 |
with col_a:
|
| 337 |
chunk_strategy = st.selectbox(
|
| 338 |
"Chunking Strategy",
|
| 339 |
+
["paragraph", "token"], # Removed 'page' as it is not implemented in new engine yet
|
| 340 |
+
help="Paragraph: Standard. Token: Dense text.",
|
| 341 |
key="chunk_selector"
|
| 342 |
)
|
| 343 |
|
| 344 |
if st.button("📥 Add to Knowledge Base", type="primary"):
|
| 345 |
with st.spinner("Ingesting..."):
|
| 346 |
+
# Note: New engine uses internal Tesseract OCR, not GPT-4o Vision
|
| 347 |
+
# so we don't pass vision flags or keys here anymore.
|
| 348 |
|
| 349 |
+
ok, msg = rag_engine.ingest_file(
|
| 350 |
+
file_path=temp_path,
|
| 351 |
+
username=st.session_state.username,
|
| 352 |
+
strategy=chunk_strategy
|
| 353 |
)
|
| 354 |
|
| 355 |
if ok:
|
| 356 |
tracker.upload_user_db(st.session_state.username) # Auto-Sync
|
| 357 |
st.success(msg)
|
| 358 |
+
else:
|
| 359 |
+
st.error(msg))
|
| 360 |
|
| 361 |
# 2. SUMMARIZE
|
| 362 |
with col_b:
|