Constrain chatbot height
Browse files- app.py +5 -12
- videos/tempfile.mp4 +2 -2
app.py
CHANGED
|
@@ -324,7 +324,8 @@ def update_foo(widget, state):
|
|
| 324 |
return state
|
| 325 |
|
| 326 |
|
| 327 |
-
with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
|
|
| 328 |
llm_state = gr.State()
|
| 329 |
history_state = gr.State()
|
| 330 |
chain_state = gr.State()
|
|
@@ -353,8 +354,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 353 |
openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...)",
|
| 354 |
show_label=False, lines=1, type='password')
|
| 355 |
|
| 356 |
-
with gr.Row():
|
| 357 |
-
with gr.Column(scale=
|
| 358 |
my_file = gr.File(label="Upload a file", type="file", visible=False)
|
| 359 |
tmp_file = gr.File("videos/Masahiro.mp4", visible=False)
|
| 360 |
tmp_file_url = "/file=" + tmp_file.value['name']
|
|
@@ -365,16 +366,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 365 |
trace_chain_cb.change(update_foo, inputs=[trace_chain_cb, trace_chain_state],
|
| 366 |
outputs=[trace_chain_state])
|
| 367 |
|
| 368 |
-
with gr.Column(scale=
|
| 369 |
chatbot = gr.Chatbot()
|
| 370 |
-
# create a chatbot that uses CSS to have a fixed height of 400px
|
| 371 |
-
chatbot.css = """
|
| 372 |
-
.gradio-chatbot {
|
| 373 |
-
height: 400px;
|
| 374 |
-
}
|
| 375 |
-
"""
|
| 376 |
-
|
| 377 |
-
|
| 378 |
|
| 379 |
with gr.Row():
|
| 380 |
message = gr.Textbox(label="What's on your mind??",
|
|
|
|
| 324 |
return state
|
| 325 |
|
| 326 |
|
| 327 |
+
# with gr.Blocks(css=".gradio-container {background-color: lightgray; #chatbot {max-height: 200}}") as block:
|
| 328 |
+
with gr.Blocks(css="#chatbot-row {max-height: 400px}") as block:
|
| 329 |
llm_state = gr.State()
|
| 330 |
history_state = gr.State()
|
| 331 |
chain_state = gr.State()
|
|
|
|
| 354 |
openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...)",
|
| 355 |
show_label=False, lines=1, type='password')
|
| 356 |
|
| 357 |
+
with gr.Row(elem_id="chatbot-row"):
|
| 358 |
+
with gr.Column(scale=1, min_width=240):
|
| 359 |
my_file = gr.File(label="Upload a file", type="file", visible=False)
|
| 360 |
tmp_file = gr.File("videos/Masahiro.mp4", visible=False)
|
| 361 |
tmp_file_url = "/file=" + tmp_file.value['name']
|
|
|
|
| 366 |
trace_chain_cb.change(update_foo, inputs=[trace_chain_cb, trace_chain_state],
|
| 367 |
outputs=[trace_chain_state])
|
| 368 |
|
| 369 |
+
with gr.Column(scale=3):
|
| 370 |
chatbot = gr.Chatbot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
|
| 372 |
with gr.Row():
|
| 373 |
message = gr.Textbox(label="What's on your mind??",
|
videos/tempfile.mp4
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:03846a675c8487597032ee227e4d1b6c8aa52391cbbf7474a994dc5b960c4443
|
| 3 |
+
size 185265
|