Gabriele Arcangelo Scalici commited on
Commit
8b1f3b1
·
1 Parent(s): 73fd8de

style: minor changes

Browse files
Files changed (1) hide show
  1. main.py +5 -3
main.py CHANGED
@@ -194,18 +194,20 @@ async def main():
194
  st.session_state["history"] = []
195
  st.session_state["past"] = ["Hey ! 👋"]
196
  st.session_state["generated"] = [
197
- "Hello ! Ask me anything about " + uploaded_file.name + " 🤗"
198
  ]
199
  response_container.empty()
200
  st.session_state["reset_chat"] = False
201
 
202
  # If the user has submitted a query
203
  if submit_button and user_input:
 
 
 
204
  # Generate a response using the Langchain ConversationalRetrievalChain
205
  output = await conversational_chat(user_input)
206
 
207
- # Add the user's input and the chatbot's output to the chat history
208
- st.session_state["past"].append(user_input)
209
  st.session_state["generated"].append(output)
210
 
211
  # If there are generated messages to display
 
194
  st.session_state["history"] = []
195
  st.session_state["past"] = ["Hey ! 👋"]
196
  st.session_state["generated"] = [
197
+ "Hello ! Ask me anything about the document " + uploaded_file.name + " 🤗"
198
  ]
199
  response_container.empty()
200
  st.session_state["reset_chat"] = False
201
 
202
  # If the user has submitted a query
203
  if submit_button and user_input:
204
+ # Add the user's input to the chat history
205
+ st.session_state["past"].append(user_input)
206
+
207
  # Generate a response using the Langchain ConversationalRetrievalChain
208
  output = await conversational_chat(user_input)
209
 
210
+ # Add the user's chatbot's output to the chat history
 
211
  st.session_state["generated"].append(output)
212
 
213
  # If there are generated messages to display