kidwaiaun commited on
Commit
4295b82
·
verified ·
1 Parent(s): aadc84a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -160,8 +160,8 @@ with gr.Blocks() as chat_ui:
160
  full_response = ""
161
  for word in response_generator:
162
  full_response += word + " "
163
- chat_history.append((user_input, full_response))
164
- yield chat_history
165
 
166
  send_btn.click(stream_response, inputs=[user_input, chatbot], outputs=[chatbot])
167
 
 
160
  full_response = ""
161
  for word in response_generator:
162
  full_response += word + " "
163
+ yield chat_history[:-1] + [(user_input, full_response)] # Update last message only
164
+ chat_history.append((user_input, full_response))
165
 
166
  send_btn.click(stream_response, inputs=[user_input, chatbot], outputs=[chatbot])
167