akash015 commited on
Commit
329f193
·
verified ·
1 Parent(s): 16a6a9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -276,17 +276,19 @@ async def extract_text_from_mixed_pdf(file_path):
276
  return pdf_text
277
 
278
  # Function to delete the ChromaDB collection
279
- async def delete_chroma_collection():
280
- chroma_instance = await cl.make_async(Chroma)()
281
- await chroma_instance.delete_collection()
282
 
283
  @cl.on_chat_start
284
  async def on_chat_start():
285
 
286
  files = None # Initialize variable to store uploaded files
287
 
 
 
 
288
  # Delete the existing ChromaDB collection
289
- await delete_chroma_collection()
290
 
291
  # Wait for the user to upload a file
292
  while files is None:
 
276
  return pdf_text
277
 
278
  # Function to delete the ChromaDB collection
279
+ async def delete_chroma_collection(chroma_instance):
280
+ chroma_instance.delete_collection()
 
281
 
282
  @cl.on_chat_start
283
  async def on_chat_start():
284
 
285
  files = None # Initialize variable to store uploaded files
286
 
287
+ # Initialize ChromaDB
288
+ chroma_instance = await cl.make_async(Chroma.from_texts)([], None)
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: