Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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:
|