Update app.py
Browse files
app.py
CHANGED
|
@@ -76,7 +76,7 @@ def get_messages_html(messages):
|
|
| 76 |
</div>
|
| 77 |
</div>
|
| 78 |
"""
|
| 79 |
-
# Robust Auto-Scroll Script
|
| 80 |
html += """
|
| 81 |
</div>
|
| 82 |
<script>
|
|
@@ -150,13 +150,15 @@ body, .gradio-container, .main-title, #chat-container, #side-panel, textarea, bu
|
|
| 150 |
}
|
| 151 |
"""
|
| 152 |
|
| 153 |
-
|
|
|
|
| 154 |
user_session = gr.State(None)
|
| 155 |
current_room = gr.State("Main")
|
| 156 |
dm_target = gr.State(None)
|
| 157 |
|
| 158 |
-
|
| 159 |
-
|
|
|
|
| 160 |
login_btn = gr.LoginButton(scale=0, elem_classes="login-button")
|
| 161 |
|
| 162 |
with gr.Row(visible=False) as chat_ui:
|
|
@@ -237,4 +239,8 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", neutral_hue="slate"),
|
|
| 237 |
room_list.change(lambda name: (name, None), room_list, [current_room, dm_target])
|
| 238 |
start_dm_btn.click(lambda target: ("Main", target), dm_user_input, [current_room, dm_target])
|
| 239 |
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
</div>
|
| 77 |
</div>
|
| 78 |
"""
|
| 79 |
+
# Robust Auto-Scroll Script
|
| 80 |
html += """
|
| 81 |
</div>
|
| 82 |
<script>
|
|
|
|
| 150 |
}
|
| 151 |
"""
|
| 152 |
|
| 153 |
+
# Updated Blocks constructor for Gradio 6.0+ compatibility
|
| 154 |
+
with gr.Blocks() as demo:
|
| 155 |
user_session = gr.State(None)
|
| 156 |
current_room = gr.State("Main")
|
| 157 |
dm_target = gr.State(None)
|
| 158 |
|
| 159 |
+
# Removed vertical_align as it is no longer supported in Row.__init__
|
| 160 |
+
with gr.Row(elem_classes="main-title"):
|
| 161 |
+
gr.Markdown("### 😊 HF Live Community Chat")
|
| 162 |
login_btn = gr.LoginButton(scale=0, elem_classes="login-button")
|
| 163 |
|
| 164 |
with gr.Row(visible=False) as chat_ui:
|
|
|
|
| 239 |
room_list.change(lambda name: (name, None), room_list, [current_room, dm_target])
|
| 240 |
start_dm_btn.click(lambda target: ("Main", target), dm_user_input, [current_room, dm_target])
|
| 241 |
|
| 242 |
+
# Pass theme and css to launch() for Gradio 6.0+
|
| 243 |
+
demo.launch(
|
| 244 |
+
theme=gr.themes.Soft(primary_hue="orange", neutral_hue="slate"),
|
| 245 |
+
css=custom_css
|
| 246 |
+
)
|