Skip to content

Commit

Permalink
Merge pull request xtekky#269 from cckuailong/main
Browse files Browse the repository at this point in the history
Fix unicode error in streamlit_chat_app.py
  • Loading branch information
xtekky authored Apr 29, 2023
2 parents c99031a + 7bfb7fc commit 55217bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gui/streamlit_chat_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ def exit_handler():

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

Expand Down

0 comments on commit 55217bb

Please sign in to comment.