eagle0504 commited on
Commit
a4c8bd9
Β·
verified Β·
1 Parent(s): 944ebc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -18,6 +18,11 @@ temperature = st.sidebar.slider("πŸ”₯ Temperature (Creativity)", 0.0, 1.0, 0.7)
18
  top_k = st.sidebar.slider("🎯 Top K (Diversity Filter)", 1, 500, 150)
19
  top_p = st.sidebar.slider("πŸ“Š Top P (Probability Sampling)", 0.0, 1.0, 0.98)
20
 
 
 
 
 
 
21
  # Initialize chat history
22
  if "messages" not in st.session_state:
23
  st.session_state.messages = []
 
18
  top_k = st.sidebar.slider("🎯 Top K (Diversity Filter)", 1, 500, 150)
19
  top_p = st.sidebar.slider("πŸ“Š Top P (Probability Sampling)", 0.0, 1.0, 0.98)
20
 
21
+ # Button to clear chat history
22
+ if st.sidebar.button("πŸ—‘οΈ Clear Chat History"):
23
+ st.session_state.messages = [] # Reset conversation history
24
+ st.experimental_rerun() # Refresh the app
25
+
26
  # Initialize chat history
27
  if "messages" not in st.session_state:
28
  st.session_state.messages = []