From 7bfb7fcb3c4a8131c49cea574c867736dbfed9df Mon Sep 17 00:00:00 2001 From: cckuailong <346813862@qq.com> Date: Sat, 29 Apr 2023 07:38:23 +0800 Subject: [PATCH] Update streamlit_chat_app.py --- gui/streamlit_chat_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/streamlit_chat_app.py b/gui/streamlit_chat_app.py index dce8ef2..1c0dd92 100644 --- a/gui/streamlit_chat_app.py +++ b/gui/streamlit_chat_app.py @@ -76,9 +76,10 @@ submit_button = st.button("Submit") if user_input or submit_button: output = query(user_input, st.session_state['query_method']) + escaped_output = output.encode('utf-8').decode('unicode-escape') st.session_state.current_conversation['user_inputs'].append(user_input) - st.session_state.current_conversation['generated_responses'].append(output) + st.session_state.current_conversation['generated_responses'].append(escaped_output) save_conversations(st.session_state.conversations, st.session_state.current_conversation) user_input = input_placeholder.text_input('You:', value='', key=f'input_text_{len(st.session_state["current_conversation"]["user_inputs"])}') # Clear the input field