Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -275,9 +275,9 @@ async def extract_text_from_mixed_pdf(file_path):
|
|
275 |
pdf_text += text
|
276 |
return pdf_text
|
277 |
|
278 |
-
# Function to
|
279 |
-
async def
|
280 |
-
await chroma_instance.
|
281 |
|
282 |
@cl.on_chat_start
|
283 |
async def on_chat_start():
|
@@ -287,8 +287,8 @@ async def on_chat_start():
|
|
287 |
# Initialize ChromaDB
|
288 |
chroma_instance = await cl.make_async(Chroma)()
|
289 |
|
290 |
-
#
|
291 |
-
await
|
292 |
|
293 |
# Wait for the user to upload a file
|
294 |
while files is None:
|
|
|
275 |
pdf_text += text
|
276 |
return pdf_text
|
277 |
|
278 |
+
# Function to delete the ChromaDB collection
|
279 |
+
async def delete_chroma_collection(chroma_instance):
|
280 |
+
await chroma_instance.delete_collection(name="default")
|
281 |
|
282 |
@cl.on_chat_start
|
283 |
async def on_chat_start():
|
|
|
287 |
# Initialize ChromaDB
|
288 |
chroma_instance = await cl.make_async(Chroma)()
|
289 |
|
290 |
+
# Delete the existing ChromaDB collection
|
291 |
+
await delete_chroma_collection(chroma_instance)
|
292 |
|
293 |
# Wait for the user to upload a file
|
294 |
while files is None:
|