andreska commited on
Commit
33f3314
·
verified ·
1 Parent(s): 82af3b6

Stream output try#2

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