Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,12 @@ def store_document_data(PDF_FILE):
|
|
| 64 |
|
| 65 |
index_file = "index.bin"
|
| 66 |
faiss.write_index(index, index_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
doc_index = index.ntotal - 1
|
|
|
|
| 68 |
with open(index_file, "rb") as f:
|
| 69 |
f.seek(0)
|
| 70 |
print(f)
|
|
|
|
| 64 |
|
| 65 |
index_file = "index.bin"
|
| 66 |
faiss.write_index(index, index_file)
|
| 67 |
+
|
| 68 |
+
faiss_index = faiss.read_index(index_file)
|
| 69 |
+
print("FAISS index loaded successfully. Number of vectors:", faiss_index.ntotal)
|
| 70 |
+
|
| 71 |
doc_index = index.ntotal - 1
|
| 72 |
+
|
| 73 |
with open(index_file, "rb") as f:
|
| 74 |
f.seek(0)
|
| 75 |
print(f)
|