cryogenic22 commited on
Commit
b042787
·
verified ·
1 Parent(s): 1118663

Update utils/database.py

Browse files
Files changed (1) hide show
  1. utils/database.py +1 -39
utils/database.py CHANGED
@@ -256,45 +256,7 @@ def handle_document_upload(uploaded_files):
256
  time.sleep(5)
257
  progress_container.empty()
258
 
259
- def display_vector_store_info():
260
- """Display information about the current vector store state."""
261
- if 'vector_store' not in st.session_state:
262
- st.info("ℹ️ No documents loaded yet.")
263
- return
264
-
265
- try:
266
- # Get basic stats
267
- test_query = vector_store.similarity_search("test", k=1)
268
- doc_count = len(test_query)
269
-
270
- # Create an expander for detailed info
271
- with st.expander("📊 Knowledge Base Status"):
272
- col1, col2 = st.columns(2)
273
-
274
- with col1:
275
- st.metric(
276
- label="Documents Loaded",
277
- value=doc_count
278
- )
279
-
280
- with col2:
281
- st.metric(
282
- label="System Status",
283
- value="Ready" if verify_vector_store(vector_store) else "Not Ready"
284
- )
285
-
286
- # Display sample queries
287
- if verify_vector_store(vector_store):
288
- st.markdown("### 🔍 Sample Document Snippets")
289
- sample_docs = vector_store.similarity_search("", k=3)
290
- for i, doc in enumerate(sample_docs, 1):
291
- with st.container():
292
- st.markdown(f"**Snippet {i}:**")
293
- st.text(doc.page_content[:200] + "...")
294
-
295
- except Exception as e:
296
- st.error(f"Error displaying vector store info: {e}")
297
-
298
  def initialize_qa_system(vector_store):
299
  """Initialize QA system with proper chat handling."""
300
  try:
 
256
  time.sleep(5)
257
  progress_container.empty()
258
 
259
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  def initialize_qa_system(vector_store):
261
  """Initialize QA system with proper chat handling."""
262
  try: