Sharal commited on
Commit
446abed
·
verified ·
1 Parent(s): 08a8205

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -187,9 +187,8 @@ def main():
187
  st.session_state['chat_history'] = chat_history
188
  st.session_state['sources'] = sources
189
 
190
- # Clear the input field and rerun the app to refresh the display
191
- st.session_state['message_input'] = "" # Clear the input field
192
- st.rerun() # Force a rerun to update the UI
193
 
194
  if __name__ == "__main__":
195
  main()
 
187
  st.session_state['chat_history'] = chat_history
188
  st.session_state['sources'] = sources
189
 
190
+ # Instead of clearing `st.session_state['message_input']`, use Streamlit's `st.empty()`
191
+ st.empty() # This clears the form input
 
192
 
193
  if __name__ == "__main__":
194
  main()