SVashishta1
commited on
Commit
·
71abaa3
1
Parent(s):
264c011
Error Fix
Browse files
app.py
CHANGED
|
@@ -568,6 +568,8 @@ def create_test_html_visualization():
|
|
| 568 |
|
| 569 |
def flush_databases():
|
| 570 |
"""Flush ChromaDB and SQLite databases"""
|
|
|
|
|
|
|
| 571 |
result = []
|
| 572 |
|
| 573 |
# Flush SQLite database
|
|
@@ -598,14 +600,12 @@ def flush_databases():
|
|
| 598 |
else:
|
| 599 |
# Even if reset fails, we can still reinitialize the document assistant
|
| 600 |
# This is a workaround that creates a fresh instance
|
| 601 |
-
global document_assistant
|
| 602 |
document_assistant = DocumentAssistant()
|
| 603 |
result.append("⚠️ ChromaDB reset partially completed - created new instance")
|
| 604 |
except Exception as e:
|
| 605 |
result.append(f"❌ Error clearing ChromaDB: {str(e)}")
|
| 606 |
|
| 607 |
# Reset current context
|
| 608 |
-
global current_context
|
| 609 |
current_context = {
|
| 610 |
"file_type": None,
|
| 611 |
"file_name": None,
|
|
|
|
| 568 |
|
| 569 |
def flush_databases():
|
| 570 |
"""Flush ChromaDB and SQLite databases"""
|
| 571 |
+
global document_assistant
|
| 572 |
+
global current_context
|
| 573 |
result = []
|
| 574 |
|
| 575 |
# Flush SQLite database
|
|
|
|
| 600 |
else:
|
| 601 |
# Even if reset fails, we can still reinitialize the document assistant
|
| 602 |
# This is a workaround that creates a fresh instance
|
|
|
|
| 603 |
document_assistant = DocumentAssistant()
|
| 604 |
result.append("⚠️ ChromaDB reset partially completed - created new instance")
|
| 605 |
except Exception as e:
|
| 606 |
result.append(f"❌ Error clearing ChromaDB: {str(e)}")
|
| 607 |
|
| 608 |
# Reset current context
|
|
|
|
| 609 |
current_context = {
|
| 610 |
"file_type": None,
|
| 611 |
"file_name": None,
|