Spaces:
Sleeping
Sleeping
Try fix issue with blank output box try#2
Browse files
app.py
CHANGED
|
@@ -43,8 +43,8 @@ st.markdown(
|
|
| 43 |
)
|
| 44 |
|
| 45 |
# Define the placeholder globally (outside columns)
|
| 46 |
-
|
| 47 |
-
|
| 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 |
-
|
| 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:
|