Spaces:
Sleeping
Sleeping
Update src/PDFprocess_sample.py
Browse files- src/PDFprocess_sample.py +5 -1
src/PDFprocess_sample.py
CHANGED
|
@@ -139,7 +139,11 @@ def process_pdf(uploaded_file):
|
|
| 139 |
|
| 140 |
# Save FAISS vector store to disk
|
| 141 |
faiss_index = st.session_state.vectors.index # Extract FAISS index
|
| 142 |
-
faiss.write_index(faiss_index, "faiss_index.bin") # Save index to a binary file
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
main_placeholder.text("Vector database created!...β
β
β
")
|
| 144 |
|
| 145 |
else:
|
|
|
|
| 139 |
|
| 140 |
# Save FAISS vector store to disk
|
| 141 |
faiss_index = st.session_state.vectors.index # Extract FAISS index
|
| 142 |
+
# faiss.write_index(faiss_index, "faiss_index.bin") # Save index to a binary file
|
| 143 |
+
|
| 144 |
+
output_path = "/tmp/faiss_index.bin" # or another writable path
|
| 145 |
+
faiss.write_index(faiss_index, output_path)
|
| 146 |
+
|
| 147 |
main_placeholder.text("Vector database created!...β
β
β
")
|
| 148 |
|
| 149 |
else:
|