ofermend commited on
Commit
966dd34
β€’
1 Parent(s): cddbc52

added thinking spinner

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -94,7 +94,8 @@ def launch_bot():
94
  if st.session_state.messages[-1]["role"] != "assistant":
95
  with st.chat_message("assistant", avatar='πŸ€–'):
96
  stream = generate_response(prompt, cfg)
97
- response = st.write_stream(stream)
 
98
  message = {"role": "assistant", "content": response, "avatar": 'πŸ€–'}
99
  st.session_state.messages.append(message)
100
 
 
94
  if st.session_state.messages[-1]["role"] != "assistant":
95
  with st.chat_message("assistant", avatar='πŸ€–'):
96
  stream = generate_response(prompt, cfg)
97
+ with st.spinner('Thinking...'):
98
+ response = st.write_stream(stream)
99
  message = {"role": "assistant", "content": response, "avatar": 'πŸ€–'}
100
  st.session_state.messages.append(message)
101