Spaces:

syedmudassir16 commited on
Commit
551ec23
1 Parent(s): b2ba33f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,8 +43,8 @@ class DocumentRetrievalAndGeneration:
43
  all_texts = [split.page_content for split in self.all_splits]
44
  embeddings = self.embeddings.encode(all_texts, convert_to_tensor=True).cpu().numpy()
45
  vectordb = FAISS.from_embeddings(
46
- embeddings,
47
- self.embeddings,
48
  metadatas=[{"source": f"doc_{i}"} for i in range(len(all_texts))]
49
  )
50
  return vectordb
 
43
  all_texts = [split.page_content for split in self.all_splits]
44
  embeddings = self.embeddings.encode(all_texts, convert_to_tensor=True).cpu().numpy()
45
  vectordb = FAISS.from_embeddings(
46
+ text_embeddings=list(zip(all_texts, embeddings)), # Pairing texts with embeddings
47
+ model=self.embeddings,
48
  metadatas=[{"source": f"doc_{i}"} for i in range(len(all_texts))]
49
  )
50
  return vectordb