andreska commited on
Commit
58daa5e
·
verified ·
1 Parent(s): 7c62ad6

Try fix issue with blank output box try#2

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -43,8 +43,8 @@ st.markdown(
43
  )
44
 
45
  # Define the placeholder globally (outside columns)
46
- #placeholder = st.empty()
47
- #placeholder.markdown(f'<div class="scrollable-div"><p></p></div>', unsafe_allow_html=True)
48
 
49
  def handle_submit():
50
  user_input = st.session_state.user_input
@@ -63,12 +63,13 @@ def handle_submit():
63
  )
64
 
65
  answer = ""
66
- response_placeholder = st.empty()
67
 
68
  for chunk in response:
69
  answer += chunk['choices'][0]['delta']['content']
70
- response_placeholder.markdown(f'<div class="scrollable-div"><p>{answer}</p></div>', unsafe_allow_html=True)
71
-
 
72
  st.session_state.conversation = f"<p>{answer}</p>" + st.session_state.conversation
73
 
74
  else:
 
43
  )
44
 
45
  # Define the placeholder globally (outside columns)
46
+ placeholder = st.empty()
47
+ placeholder.markdown(f'<div class="scrollable-div"><p></p></div>', unsafe_allow_html=True)
48
 
49
  def handle_submit():
50
  user_input = st.session_state.user_input
 
63
  )
64
 
65
  answer = ""
66
+ #response_placeholder = st.empty()
67
 
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
+
72
+ placeholder.markdown(f'<div class="scrollable-div"><p>{answer}</p></div>', unsafe_allow_html=True)
73
  st.session_state.conversation = f"<p>{answer}</p>" + st.session_state.conversation
74
 
75
  else: