Update app.py
Browse files
app.py
CHANGED
|
@@ -202,6 +202,7 @@ def respond(message, history: list[dict], username):
|
|
| 202 |
|
| 203 |
# launch ChatInterface
|
| 204 |
|
|
|
|
| 205 |
with gr.Blocks() as demo:
|
| 206 |
username = gr.State()
|
| 207 |
|
|
@@ -210,7 +211,7 @@ with gr.Blocks() as demo:
|
|
| 210 |
submit_button = gr.Button("Start Chat")
|
| 211 |
|
| 212 |
# Wrap ChatInterface inside a column so we can control its visibility
|
| 213 |
-
with gr.Column(visible=False) as chatbot_container:
|
| 214 |
chatbot = gr.ChatInterface(
|
| 215 |
fn=respond,
|
| 216 |
title="YAQIN Chatbot",
|
|
@@ -235,6 +236,13 @@ demo = gr.ChatInterface(
|
|
| 235 |
type="messages",
|
| 236 |
)
|
| 237 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
if __name__ == "__main__":
|
| 240 |
demo.launch()
|
|
|
|
| 202 |
|
| 203 |
# launch ChatInterface
|
| 204 |
|
| 205 |
+
|
| 206 |
with gr.Blocks() as demo:
|
| 207 |
username = gr.State()
|
| 208 |
|
|
|
|
| 211 |
submit_button = gr.Button("Start Chat")
|
| 212 |
|
| 213 |
# Wrap ChatInterface inside a column so we can control its visibility
|
| 214 |
+
with gr.Column(visible=False, elem_id="chatbot-container") as chatbot_container:
|
| 215 |
chatbot = gr.ChatInterface(
|
| 216 |
fn=respond,
|
| 217 |
title="YAQIN Chatbot",
|
|
|
|
| 236 |
type="messages",
|
| 237 |
)
|
| 238 |
'''
|
| 239 |
+
demo.stylesheet("""
|
| 240 |
+
#chatbot-container {
|
| 241 |
+
height: 100vh !important;
|
| 242 |
+
display: flex;
|
| 243 |
+
flex-direction: column;
|
| 244 |
+
}
|
| 245 |
+
""")
|
| 246 |
|
| 247 |
if __name__ == "__main__":
|
| 248 |
demo.launch()
|