Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,9 @@ def store_document_data(PDF_FILE):
|
|
54 |
index = faiss.IndexFlatL2(embedding.shape[1])
|
55 |
index_file = "index.bin"
|
56 |
faiss.write_index(index, index_file)
|
57 |
-
|
|
|
|
|
58 |
print("sent")
|
59 |
except requests.exceptions.RequestException as e:
|
60 |
return {"error": str(e)}
|
|
|
54 |
index = faiss.IndexFlatL2(embedding.shape[1])
|
55 |
index_file = "index.bin"
|
56 |
faiss.write_index(index, index_file)
|
57 |
+
with open(index_file, "rb") as f:
|
58 |
+
response = requests.post(API_URL, files={"file": f})
|
59 |
+
|
60 |
print("sent")
|
61 |
except requests.exceptions.RequestException as e:
|
62 |
return {"error": str(e)}
|