Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -240,4 +240,18 @@ with gr.Blocks(css=".chatbox {height: 400px; overflow-y: auto; border: 1px solid
|
|
240 |
|
241 |
if __name__ == "__main__":
|
242 |
demo.queue = False
|
243 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
if __name__ == "__main__":
|
242 |
demo.queue = False
|
243 |
+
demo.launch(
|
244 |
+
js="""
|
245 |
+
function scrollToBottom() {
|
246 |
+
const container = document.getElementById('chatbox-container');
|
247 |
+
if (container) {
|
248 |
+
container.scrollTop = container.scrollHeight;
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
window.onload = scrollToBottom;
|
253 |
+
|
254 |
+
const observer = new MutationObserver(scrollToBottom);
|
255 |
+
observer.observe(document.getElementById('chatbox-container'), { childList: true, subtree: true });
|
256 |
+
"""
|
257 |
+
)
|