philipk22 commited on
Commit
3e71f6b
·
1 Parent(s): dda4828

update streamlit_app.py 4

Browse files
Files changed (1) hide show
  1. streamlit_app.py +4 -1
streamlit_app.py CHANGED
@@ -22,7 +22,10 @@ def main():
22
  # Button to clear chat history
23
  if st.button("Clear Chat History"):
24
  st.session_state.messages = []
25
- st.rerun()
 
 
 
26
 
27
  # Initialize session state
28
  if "messages" not in st.session_state:
 
22
  # Button to clear chat history
23
  if st.button("Clear Chat History"):
24
  st.session_state.messages = []
25
+ if hasattr(st, "rerun"):
26
+ st.rerun()
27
+ else:
28
+ st.experimental_rerun()
29
 
30
  # Initialize session state
31
  if "messages" not in st.session_state: