Spaces:
Running
Running
Fix buggy Send button
Browse files
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 |
-
|
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 |
-
|
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="📝")
|