Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -65,14 +65,15 @@ def get_conversational_chain():
|
|
65 |
def user_input(user_question):
|
66 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
67 |
|
68 |
-
|
|
|
|
|
69 |
docs = new_db.similarity_search(user_question)
|
70 |
|
71 |
chain = get_conversational_chain()
|
72 |
|
73 |
-
|
74 |
response = chain(
|
75 |
-
{"input_documents":docs, "question": user_question}
|
76 |
, return_only_outputs=True)
|
77 |
|
78 |
print(response)
|
|
|
65 |
def user_input(user_question):
|
66 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
67 |
|
68 |
+
# Load the FAISS index with dangerous deserialization allowed
|
69 |
+
new_db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
70 |
+
|
71 |
docs = new_db.similarity_search(user_question)
|
72 |
|
73 |
chain = get_conversational_chain()
|
74 |
|
|
|
75 |
response = chain(
|
76 |
+
{"input_documents": docs, "question": user_question}
|
77 |
, return_only_outputs=True)
|
78 |
|
79 |
print(response)
|