Sharal commited on
Commit
ff78141
·
verified ·
1 Parent(s): 34a2b68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -175,7 +175,7 @@ def main():
175
  st.text_area(f"Source {i + 1} - Page {source['page']}", value=source["content"], height=100)
176
 
177
  with st.form(key="question_form"):
178
- message = st.text_input("Ask a question", key="message")
179
  submit_button = st.form_submit_button(label="Submit")
180
 
181
  if submit_button:
@@ -186,9 +186,10 @@ def main():
186
  st.session_state['chat_history'] = chat_history
187
  st.session_state['sources'] = sources
188
 
189
- # Clear the input by setting the message to an empty string
190
- # and rerun the app to refresh the display
191
- st.experimental_rerun()
192
 
193
  if __name__ == "__main__":
194
  main()
 
 
175
  st.text_area(f"Source {i + 1} - Page {source['page']}", value=source["content"], height=100)
176
 
177
  with st.form(key="question_form"):
178
+ message = st.text_input("Ask a question", key="message_input")
179
  submit_button = st.form_submit_button(label="Submit")
180
 
181
  if submit_button:
 
186
  st.session_state['chat_history'] = chat_history
187
  st.session_state['sources'] = sources
188
 
189
+ # Clear the input field and rerun the app to refresh the display
190
+ st.session_state['message_input'] = "" # Clear the input field
191
+ st.rerun() # Force a rerun to update the UI
192
 
193
  if __name__ == "__main__":
194
  main()
195
+