Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,7 +142,20 @@ def render_message(history):
|
|
| 142 |
|
| 143 |
return messages_html + scroll_script
|
| 144 |
|
| 145 |
-
with gr.Blocks(css=".chatbox {height: 400px; overflow-y: auto; border: 1px solid #262626; padding: 10px; background-color: #171717;}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
with gr.Column(visible=True) as auth_view:
|
| 148 |
gr.Markdown("## P-MSQ Authorization")
|
|
@@ -236,20 +249,6 @@ with gr.Blocks(css=".chatbox {height: 400px; overflow-y: auto; border: 1px solid
|
|
| 236 |
auth_button.click(authorize_and_proceed, inputs=[api_user_input, api_key_input], outputs=[auth_view, chat_view, chatbot_output, history_state])
|
| 237 |
save_instructions_btn.click(save_custom_instructions, inputs=[api_key_input, system_instructions_input], outputs=auth_status)
|
| 238 |
demo.load(lambda: None, [], None)
|
| 239 |
-
demo.launch(
|
| 240 |
-
js="""
|
| 241 |
-
function scrollToBottom() {
|
| 242 |
-
const container = document.getElementById('chatbox-container');
|
| 243 |
-
if (container) {
|
| 244 |
-
container.scrollTop = container.scrollHeight;
|
| 245 |
-
}
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
window.onload = scrollToBottom;
|
| 249 |
-
|
| 250 |
-
const observer = new MutationObserver(scrollToBottom);
|
| 251 |
-
observer.observe(document.getElementById('chatbox-container'), { childList: true, subtree: true });
|
| 252 |
-
"""
|
| 253 |
-
)
|
| 254 |
if __name__ == "__main__":
|
| 255 |
demo.queue = False
|
|
|
|
| 142 |
|
| 143 |
return messages_html + scroll_script
|
| 144 |
|
| 145 |
+
with gr.Blocks(css=".chatbox {height: 400px; overflow-y: auto; border: 1px solid #262626; padding: 10px; background-color: #171717;}",
|
| 146 |
+
js="""
|
| 147 |
+
function scrollToBottom() {
|
| 148 |
+
const container = document.getElementById('chatbox-container');
|
| 149 |
+
if (container) {
|
| 150 |
+
container.scrollTop = container.scrollHeight;
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
window.onload = scrollToBottom;
|
| 155 |
+
|
| 156 |
+
const observer = new MutationObserver(scrollToBottom);
|
| 157 |
+
observer.observe(document.getElementById('chatbox-container'), { childList: true, subtree: true });
|
| 158 |
+
""") as demo:
|
| 159 |
|
| 160 |
with gr.Column(visible=True) as auth_view:
|
| 161 |
gr.Markdown("## P-MSQ Authorization")
|
|
|
|
| 249 |
auth_button.click(authorize_and_proceed, inputs=[api_user_input, api_key_input], outputs=[auth_view, chat_view, chatbot_output, history_state])
|
| 250 |
save_instructions_btn.click(save_custom_instructions, inputs=[api_key_input, system_instructions_input], outputs=auth_status)
|
| 251 |
demo.load(lambda: None, [], None)
|
| 252 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
if __name__ == "__main__":
|
| 254 |
demo.queue = False
|