gauri-sharan commited on
Commit
bc401e8
·
verified ·
1 Parent(s): 3077ea4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -28,6 +28,9 @@ def ocr_and_extract(image, text_query):
28
  temp_image_path = "temp_image.jpg"
29
  image.save(temp_image_path)
30
 
 
 
 
31
  # Index the image with Byaldi
32
  rag_model.index(
33
  input_path=temp_image_path,
 
28
  temp_image_path = "temp_image.jpg"
29
  image.save(temp_image_path)
30
 
31
+ # Clear the index before adding a new image to avoid conflicts
32
+ rag_model.delete_index("image_index")
33
+
34
  # Index the image with Byaldi
35
  rag_model.index(
36
  input_path=temp_image_path,