Update app.py
Browse files
app.py
CHANGED
|
@@ -139,7 +139,11 @@ def download_database():
|
|
| 139 |
@app.post("/admin/database/upload")
|
| 140 |
def upload_database(file: UploadFile = File(...)):
|
| 141 |
# Read the contents of the uploaded file
|
| 142 |
-
contents = file.file.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
# Load the FAISS index from the file contents
|
| 145 |
global index
|
|
|
|
| 139 |
@app.post("/admin/database/upload")
|
| 140 |
def upload_database(file: UploadFile = File(...)):
|
| 141 |
# Read the contents of the uploaded file
|
| 142 |
+
#contents = file.file.read()
|
| 143 |
+
|
| 144 |
+
# Open the uploaded file as a binary file object
|
| 145 |
+
with open(file.filename, "wb") as f:
|
| 146 |
+
f.write(file.file.read())
|
| 147 |
|
| 148 |
# Load the FAISS index from the file contents
|
| 149 |
global index
|