Spaces:
Running
Running
Update app.py
Browse files
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 = []
|