Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,8 @@ def get_conversational_chain():
|
|
44 |
def user_input(user_question, hf):
|
45 |
"""Processes user question and provides a response"""
|
46 |
try:
|
47 |
-
|
|
|
48 |
docs = new_db.similarity_search(user_question)
|
49 |
except FileNotFoundError:
|
50 |
st.error("No index found. Please upload PDFs and click 'Submit & Process' first.")
|
@@ -90,4 +91,4 @@ def main():
|
|
90 |
user_input(user_question, hf)
|
91 |
|
92 |
if __name__ == "__main__":
|
93 |
-
main()
|
|
|
44 |
def user_input(user_question, hf):
|
45 |
"""Processes user question and provides a response"""
|
46 |
try:
|
47 |
+
# Load the FAISS index without the 'allow_dangerous_deserialization' argument
|
48 |
+
new_db = FAISS.load_local("faiss_index", hf)
|
49 |
docs = new_db.similarity_search(user_question)
|
50 |
except FileNotFoundError:
|
51 |
st.error("No index found. Please upload PDFs and click 'Submit & Process' first.")
|
|
|
91 |
user_input(user_question, hf)
|
92 |
|
93 |
if __name__ == "__main__":
|
94 |
+
main()
|