akash015 commited on
Commit
982ba10
·
verified ·
1 Parent(s): 43aad56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 clear the ChromaDB
279
- async def clear_chroma_db(chroma_instance):
280
- await chroma_instance.delete()
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
- # Clear any existing data in ChromaDB
291
- await clear_chroma_db(chroma_instance)
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: