Spaces:
Sleeping
Sleeping
Stream output try#2
Browse files
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 |
-
|
| 67 |
-
st.
|
| 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 |
|