Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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.
|
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 |
|