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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -79,11 +79,10 @@ if prompt := st.chat_input():
79
  st.session_state["messages"].append({"role": "user", "content": prompt})
80
  st.chat_message("user").write(prompt)
81
 
82
- # Display a placeholder for the assistant's 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})
 
79
  st.session_state["messages"].append({"role": "user", "content": prompt})
80
  st.chat_message("user").write(prompt)
81
 
 
 
 
82
  with st.spinner("Translating Dubs language (Woof Woof!)"):
83
+ assistant_message_placeholder = st.chat_message("assistant").empty()
84
+ response_stream = call_api_stream(prompt)
85
+ assistant_message_placeholder.write_stream(response_stream)
86
 
87
  # Append the final assistant's response to the chat history
88
  st.session_state["messages"].append({"role": "assistant", "content": bot_response})