Spaces:
Sleeping
Sleeping
Commit
·
a3ab209
1
Parent(s):
e9362af
updated pom file
Browse files
app.py
CHANGED
@@ -196,3 +196,19 @@ if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr):
|
|
196 |
input_key="question")
|
197 |
answer = chain.run(chatTextStr)
|
198 |
st.write(answer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
input_key="question")
|
197 |
answer = chain.run(chatTextStr)
|
198 |
st.write(answer)
|
199 |
+
|
200 |
+
# Define the scroll operation as a function and pass in something unique for each
|
201 |
+
# page load that it needs to re-evaluate where "bottom" is
|
202 |
+
js = f"""
|
203 |
+
<script>
|
204 |
+
function scroll(dummy_var_to_force_repeat_execution){{
|
205 |
+
var textAreas = parent.document.querySelectorAll('section.main');
|
206 |
+
for (let index = 0; index < textAreas.length; index++) {{
|
207 |
+
textAreas[index].style.color = 'red'
|
208 |
+
textAreas[index].scrollTop = textAreas[index].scrollHeight;
|
209 |
+
}}
|
210 |
+
}}
|
211 |
+
scroll({len(st.session_state.chat)})
|
212 |
+
</script>
|
213 |
+
"""
|
214 |
+
st.components.v1.html(js)
|