abanm commited on
Commit
4d82d2e
·
verified ·
1 Parent(s): 8b91edf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -83,10 +83,7 @@ if prompt := st.chat_input():
83
  assistant_message_placeholder = st.chat_message("assistant").empty()
84
 
85
  with st.spinner("Translating Dubs language (Woof Woof!)"):
86
- bot_response = ""
87
- for partial_response in call_api(prompt):
88
- bot_response += partial_response
89
- assistant_message_placeholder.write(bot_response) # Update incrementally
90
 
91
  # Append the final assistant's response to the chat history
92
  st.session_state["messages"].append({"role": "assistant", "content": bot_response})
 
83
  assistant_message_placeholder = st.chat_message("assistant").empty()
84
 
85
  with st.spinner("Translating Dubs language (Woof Woof!)"):
86
+ assistant_message_placeholder.write_stream(call_api(prompt)) # Update incrementally
 
 
 
87
 
88
  # Append the final assistant's response to the chat history
89
  st.session_state["messages"].append({"role": "assistant", "content": bot_response})