sahanes commited on
Commit
b0c41b3
·
verified ·
1 Parent(s): 4252415

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -20,11 +20,12 @@ from langchain_community.vectorstores.faiss import FAISS
20
 
21
 
22
  db = FAISS.read_index('index.pkl')
23
-
 
24
  #-----------------------------------------------------------------------------
25
  def get_response_from_query(db, query, k=3):
26
 
27
- docs = db.search(query, k=k)
28
 
29
  docs_page_content = " ".join([d.page_content for d in docs])
30
 
 
20
 
21
 
22
  db = FAISS.read_index('index.pkl')
23
+ db.save_local("faiss_index")
24
+ db=FAISS.load_local("faiss_index", embeddings,allow_dangerous_deserialization=True)
25
  #-----------------------------------------------------------------------------
26
  def get_response_from_query(db, query, k=3):
27
 
28
+ docs = db.similarity_search(query, k=k)
29
 
30
  docs_page_content = " ".join([d.page_content for d in docs])
31