Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,6 +70,10 @@ if st.session_state.selected_model != model_option:
|
|
| 70 |
st.session_state.messages = []
|
| 71 |
st.session_state.selected_model = model_option
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
# Display chat messages from history on app rerun
|
| 74 |
for message in st.session_state.messages:
|
| 75 |
avatar = "🤖" if message["role"] == "assistant" else "🕺"
|
|
|
|
| 70 |
st.session_state.messages = []
|
| 71 |
st.session_state.selected_model = model_option
|
| 72 |
|
| 73 |
+
# Add a "Clear Chat" button
|
| 74 |
+
if st.button("Clear Chat"):
|
| 75 |
+
st.session_state.messages = []
|
| 76 |
+
|
| 77 |
# Display chat messages from history on app rerun
|
| 78 |
for message in st.session_state.messages:
|
| 79 |
avatar = "🤖" if message["role"] == "assistant" else "🕺"
|