Spaces:

syedmudassir16 commited on
Commit
79aa22e
1 Parent(s): c47e967

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -48,11 +48,14 @@ class DocumentRetrievalAndGeneration:
48
  index = faiss.IndexFlatL2(vector_dimension)
49
  index.add(embeddings)
50
 
 
 
 
51
  # Create and return FAISS object
52
  return FAISS(
53
  embedding_function=self.embeddings.encode,
54
  index=index,
55
- docstore=self.all_splits,
56
  index_to_docstore_id={i: i for i in range(len(self.all_splits))}
57
  )
58
 
 
48
  index = faiss.IndexFlatL2(vector_dimension)
49
  index.add(embeddings)
50
 
51
+ # Create docstore
52
+ docstore = {i: doc for i, doc in enumerate(self.all_splits)}
53
+
54
  # Create and return FAISS object
55
  return FAISS(
56
  embedding_function=self.embeddings.encode,
57
  index=index,
58
+ docstore=docstore,
59
  index_to_docstore_id={i: i for i in range(len(self.all_splits))}
60
  )
61