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