Spaces:
Running
Running
fix another state-management bug
Browse files
app.py
CHANGED
@@ -221,7 +221,7 @@ def type_assistant_response():
|
|
221 |
for i, message in enumerate(st.session_state.messages[:-1]):
|
222 |
with st.chat_message(message["role"]):
|
223 |
st.markdown(message["content"])
|
224 |
-
st.button("Edit", on_click=rewind_to, args=(i,))
|
225 |
|
226 |
# Display message-in-progress in chat message container
|
227 |
last_role = messages[-1]["role"]
|
|
|
221 |
for i, message in enumerate(st.session_state.messages[:-1]):
|
222 |
with st.chat_message(message["role"]):
|
223 |
st.markdown(message["content"])
|
224 |
+
st.button("Edit", on_click=rewind_to, args=(i,), key=f"rewind_to_{i}")
|
225 |
|
226 |
# Display message-in-progress in chat message container
|
227 |
last_role = messages[-1]["role"]
|