andreska commited on
Commit
b9243a0
·
verified ·
1 Parent(s): a964187

Try to reapply Stream properties instead of waiting for the whole text to complete

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -67,8 +67,9 @@ def handle_submit():
67
  answer = ""
68
  for chunk in response:
69
  answer += chunk['choices'][0]['delta']['content']
70
- placeholder.markdown(f'<div class="scrollable-div"><p>{answer}</p></div>', unsafe_allow_html=True)
71
- st.session_state.conversation = f"<p>{answer}</p>" + st.session_state.conversation
 
72
  else:
73
  st.session_state.conversation(f"<p><strong>Adrega AI:</strong>: Please enter a question.")
74
 
 
67
  answer = ""
68
  for chunk in response:
69
  answer += chunk['choices'][0]['delta']['content']
70
+ placeholder.markdown(f'<div class="scrollable-div"><p>{answer}</p></div>', unsafe_allow_html=True)
71
+ st.session_state.conversation = f"<p>{answer}</p>" + st.session_state.conversation
72
+ placeholder.empty()
73
  else:
74
  st.session_state.conversation(f"<p><strong>Adrega AI:</strong>: Please enter a question.")
75