Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,14 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
import spaces
|
| 4 |
from chatbot_logic import get_bot_response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# === User Preference State ===
|
| 7 |
user_preferences = {
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import spaces
|
| 4 |
from chatbot_logic import get_bot_response
|
| 5 |
+
from knowledge_base import load_and_chunk_pdfs, create_vectorstore
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
if not os.path.exists("chroma/index"):
|
| 9 |
+
print("Vectorstore missing or empty — running ingestion.")
|
| 10 |
+
chunks = load_and_chunk_pdfs("meal_plans")
|
| 11 |
+
create_vectorstore(chunks)
|
| 12 |
+
|
| 13 |
|
| 14 |
# === User Preference State ===
|
| 15 |
user_preferences = {
|