RomZay commited on
Commit
6b3434b
·
verified ·
1 Parent(s): d028f9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
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
+ )