Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -122,17 +122,36 @@ def process_user_question(user_question):
|
|
122 |
st.session_state.chat_history = response['chat_history']
|
123 |
|
124 |
# st.empty()
|
|
|
125 |
|
126 |
for i, message in enumerate(st.session_state.chat_history):
|
127 |
if i % 2 == 0:
|
128 |
st.write(user_template.replace(
|
129 |
"{{MSG}}", message.content), unsafe_allow_html=True)
|
130 |
|
|
|
|
|
131 |
else:
|
132 |
st.write(bot_template.replace(
|
133 |
"{{MSG}}", message.content), unsafe_allow_html=True)
|
134 |
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
# with st.container() as scrollable_container:
|
137 |
# # Your content to be scrolled goes here
|
138 |
# for i in range(100):
|
|
|
122 |
st.session_state.chat_history = response['chat_history']
|
123 |
|
124 |
# st.empty()
|
125 |
+
user_string = [""]
|
126 |
|
127 |
for i, message in enumerate(st.session_state.chat_history):
|
128 |
if i % 2 == 0:
|
129 |
st.write(user_template.replace(
|
130 |
"{{MSG}}", message.content), unsafe_allow_html=True)
|
131 |
|
132 |
+
user_string += message.content
|
133 |
+
|
134 |
else:
|
135 |
st.write(bot_template.replace(
|
136 |
"{{MSG}}", message.content), unsafe_allow_html=True)
|
137 |
|
138 |
|
139 |
+
|
140 |
+
from streamlit.components.v1 import html
|
141 |
+
|
142 |
+
lorem = (
|
143 |
+
"""
|
144 |
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nisl nec
|
145 |
+
vulputate lacinia, nunc nisl aliquam mauris, eget aliquet nisl nisl et nunc.
|
146 |
+
Sed euismod, nisl nec vulputate lacinia, nunc nisl aliquam mauris, eget aliquet.</p>
|
147 |
+
"""
|
148 |
+
* 10
|
149 |
+
)
|
150 |
+
|
151 |
+
# html(lorem, height=100, scrolling=True)
|
152 |
+
html(user_string, height=100, scrolling=True)
|
153 |
+
|
154 |
+
|
155 |
# with st.container() as scrollable_container:
|
156 |
# # Your content to be scrolled goes here
|
157 |
# for i in range(100):
|