Spaces:
Paused
Paused
Update utils/database.py
Browse files- utils/database.py +4 -0
utils/database.py
CHANGED
|
@@ -281,6 +281,9 @@ def display_vector_store_info():
|
|
| 281 |
return
|
| 282 |
|
| 283 |
try:
|
|
|
|
|
|
|
|
|
|
| 284 |
# Get basic stats
|
| 285 |
test_query = vector_store.similarity_search("test", k=1)
|
| 286 |
doc_count = len(test_query)
|
|
@@ -312,6 +315,7 @@ def display_vector_store_info():
|
|
| 312 |
|
| 313 |
except Exception as e:
|
| 314 |
st.error(f"Error displaying vector store info: {e}")
|
|
|
|
| 315 |
|
| 316 |
def initialize_qa_system(vector_store):
|
| 317 |
"""Initialize QA system with proper chat handling."""
|
|
|
|
| 281 |
return
|
| 282 |
|
| 283 |
try:
|
| 284 |
+
# Get the vector store from session state
|
| 285 |
+
vector_store = st.session_state.vector_store
|
| 286 |
+
|
| 287 |
# Get basic stats
|
| 288 |
test_query = vector_store.similarity_search("test", k=1)
|
| 289 |
doc_count = len(test_query)
|
|
|
|
| 315 |
|
| 316 |
except Exception as e:
|
| 317 |
st.error(f"Error displaying vector store info: {e}")
|
| 318 |
+
st.error(traceback.format_exc())
|
| 319 |
|
| 320 |
def initialize_qa_system(vector_store):
|
| 321 |
"""Initialize QA system with proper chat handling."""
|