Spaces:
Running
Running
shubhendu-ghosh
commited on
Commit
•
1161ef7
1
Parent(s):
b876dee
Update app.py
Browse files
app.py
CHANGED
@@ -88,16 +88,16 @@ def get_conversational_chain():
|
|
88 |
|
89 |
def user_input(user_question):
|
90 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
91 |
-
try:
|
92 |
new_db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
93 |
docs = new_db.similarity_search(user_question)
|
94 |
except Exception as e:
|
95 |
st.markdown(f"""<p style="color: #e80000;font-size: 15px;font-family: sans-serif; text-align:left;margin-bottom: 0px; height: 5px">Document not submitted. Please upload a pdf and then click on 'submit'. Only then we can answer your question</p>""", unsafe_allow_html=True)
|
96 |
-
return None
|
97 |
|
98 |
|
99 |
-
|
100 |
-
|
101 |
|
102 |
chain = get_conversational_chain()
|
103 |
|
|
|
88 |
|
89 |
def user_input(user_question):
|
90 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
91 |
+
'''try:
|
92 |
new_db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
93 |
docs = new_db.similarity_search(user_question)
|
94 |
except Exception as e:
|
95 |
st.markdown(f"""<p style="color: #e80000;font-size: 15px;font-family: sans-serif; text-align:left;margin-bottom: 0px; height: 5px">Document not submitted. Please upload a pdf and then click on 'submit'. Only then we can answer your question</p>""", unsafe_allow_html=True)
|
96 |
+
return None '''
|
97 |
|
98 |
|
99 |
+
new_db = FAISS.load_local("faiss_index", embeddings)
|
100 |
+
docs = new_db.similarity_search(user_question)
|
101 |
|
102 |
chain = get_conversational_chain()
|
103 |
|