kcarnold commited on
Commit
b7e2540
·
1 Parent(s): 33bf88c

Fix buggy Send button

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -274,11 +274,11 @@ def type_assistant_response():
274
  token_display = show_token(token)
275
  st.button(token_display, on_click=append_token, args=(token,), key=i, use_container_width=True)
276
 
277
- if st.button("Send"):
278
  other_role = "assistant" if last_role == "user" else "user"
279
- messages.append({"role": other_role, "content": ""})
280
  st.session_state['msg_in_progress'] = ""
281
- st.session_state.messages = messages
282
 
283
 
284
  rewrite_page = st.Page(rewrite_with_predictions, title="Rewrite with predictions", icon="📝")
 
274
  token_display = show_token(token)
275
  st.button(token_display, on_click=append_token, args=(token,), key=i, use_container_width=True)
276
 
277
+ def send_message():
278
  other_role = "assistant" if last_role == "user" else "user"
279
+ st.session_state['messages'].append({"role": other_role, "content": ""})
280
  st.session_state['msg_in_progress'] = ""
281
+ st.button("Send", on_click=send_message)
282
 
283
 
284
  rewrite_page = st.Page(rewrite_with_predictions, title="Rewrite with predictions", icon="📝")