fixes to app.py
Browse files
app.py
CHANGED
|
@@ -151,8 +151,8 @@ async def upload_file(file: UploadFile = File(...)):
|
|
| 151 |
index.add(embeddings)
|
| 152 |
|
| 153 |
SESSION_DATA[session_id] = {
|
| 154 |
-
"
|
| 155 |
-
"index":
|
| 156 |
}
|
| 157 |
|
| 158 |
logger.info(f"Session {session_id} created with {len(text_chunks)} chunks.")
|
|
|
|
| 151 |
index.add(embeddings)
|
| 152 |
|
| 153 |
SESSION_DATA[session_id] = {
|
| 154 |
+
"filename": file.filename,
|
| 155 |
+
"index": faiss.write_index_buf(index), # Store the index as bytes
|
| 156 |
}
|
| 157 |
|
| 158 |
logger.info(f"Session {session_id} created with {len(text_chunks)} chunks.")
|