gauri-sharan commited on
Commit
b384e01
·
verified ·
1 Parent(s): c5b6958

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -79,6 +79,9 @@ def ocr_and_extract(image):
79
  # Clean up the temporary file
80
  os.remove(temp_image_path)
81
 
 
 
 
82
  return "\n".join(filtered_output).strip()
83
 
84
  except Exception as e:
 
79
  # Clean up the temporary file
80
  os.remove(temp_image_path)
81
 
82
+ # Clear the index after processing each image to avoid conflicts on future uploads
83
+ rag_model.clear_index(unique_index_name)
84
+
85
  return "\n".join(filtered_output).strip()
86
 
87
  except Exception as e: