Update app.py
Browse files
app.py
CHANGED
|
@@ -128,6 +128,19 @@ def download_database():
|
|
| 128 |
# Save the FAISS index to a file
|
| 129 |
faiss.write_index(index, "database.index")
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
# Create a response with the index file as the content
|
| 132 |
response = FileResponse("database.index")
|
| 133 |
|
|
|
|
| 128 |
# Save the FAISS index to a file
|
| 129 |
faiss.write_index(index, "database.index")
|
| 130 |
|
| 131 |
+
# Create a response with the index file as the content
|
| 132 |
+
response = FileResponse("database.index", media_type="application/octet-stream")
|
| 133 |
+
|
| 134 |
+
# Set the content disposition header to trigger a download
|
| 135 |
+
response.headers["Content-Disposition"] = "attachment; filename=database.index"
|
| 136 |
+
|
| 137 |
+
return response
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
def download_database_1():
|
| 141 |
+
# Save the FAISS index to a file
|
| 142 |
+
faiss.write_index(index, "database.index")
|
| 143 |
+
|
| 144 |
# Create a response with the index file as the content
|
| 145 |
response = FileResponse("database.index")
|
| 146 |
|