Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,11 +32,12 @@ collection = chroma_client.get_or_create_collection(
|
|
| 32 |
|
| 33 |
# --- Clear Collection ---
|
| 34 |
def clear_collection():
|
| 35 |
-
all_items = collection.get(
|
| 36 |
if all_items and "ids" in all_items:
|
| 37 |
collection.delete(ids=all_items["ids"])
|
| 38 |
st.info(f"Cleared {len(all_items['ids'])} existing documents from ChromaDB.")
|
| 39 |
|
|
|
|
| 40 |
# --- Ingest JSON Files from /docs/ ---
|
| 41 |
def ingest_docs_to_chroma():
|
| 42 |
folder_path = "./docs"
|
|
|
|
| 32 |
|
| 33 |
# --- Clear Collection ---
|
| 34 |
def clear_collection():
|
| 35 |
+
all_items = collection.get()
|
| 36 |
if all_items and "ids" in all_items:
|
| 37 |
collection.delete(ids=all_items["ids"])
|
| 38 |
st.info(f"Cleared {len(all_items['ids'])} existing documents from ChromaDB.")
|
| 39 |
|
| 40 |
+
|
| 41 |
# --- Ingest JSON Files from /docs/ ---
|
| 42 |
def ingest_docs_to_chroma():
|
| 43 |
folder_path = "./docs"
|