Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files410 unmodified lines41141241341441541641732 unmodified lines450451452453454455456457458459460461410 unmodified linessumm, usage = query_model_universal(msgs, 1000, model_choice, st.session_state.get("user_openai_key"))st.subheader("Summary"); st.markdown(summ)# COLUMN C: Flatten (THE FIX)with col_c:st.write(""); st.write("")if "flattened_result" not in st.session_state: st.session_state.flattened_result = None32 unmodified linesst.success("Complete!")st.text_area("Result", res["text"], height=200)if st.button("📥 Index Flat"):if not st.session_state.active_index: st.error("Select Index.")else:with st.spinner("Indexing..."):ok, msg = rag_engine.process_and_add_text(res["text"], res["source"], st.session_state.username, st.session_state.active_index)if ok: tracker.upload_user_db(st.session_state.username); st.success(msg)else: st.error(msg)st.divider()st.subheader("Database Management")410 unmodified lines41141241341441541641732 unmodified lines450451452453454455456457458459460461462463464465466467468469470471472410 unmodified linessumm, usage = query_model_universal(msgs, 1000, model_choice, st.session_state.get("user_openai_key"))st.subheader("Summary"); st.markdown(summ)# COLUMN C: Flattenwith col_c:st.write(""); st.write("")if "flattened_result" not in st.session_state: st.session_state.flattened_result = None32 unmodified linesst.success("Complete!")st.text_area("Result", res["text"], height=200)if st.button("📥 Index Flat"):if not st.session_state.active_index:st.error("Please select an Active Index.")else:with st.spinner("Indexing..."):# FIX: Pass the active_embed_model here!ok, msg = rag_engine.process_and_add_text(text=res["text"],source_name=res["source"],username=st.session_state.username,index_name=st.session_state.active_index,embed_model_name=st.session_state.active_embed_model)if ok:tracker.upload_user_db(st.session_state.username)st.success(msg)else:st.error(msg)st.divider()st.subheader("Database Management")
src/app.py+16-5