Kalpokoch commited on
Commit
e78105a
·
1 Parent(s): bc8a612

fixes to app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- "chunks": text_chunks,
155
- "index": index.serialize(), # Store the index as bytes
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.")