I need to build a layout in Gradio with two columns. The left column will contain several checkboxes, while the right column will feature a gr.Chatbot and a gr.TextBox. I want the gr.Chatbot component to be dynamically scalable in height (vertically), adjusting as the window size changes. Currently, the gr.Chatbot has a fixed height, which prevents it from resizing automatically.
I have the following code that works great and scales gr.Chatbot() in browser because of gr.Blocks(fill_height=True,fill_width=True)
with gr.Blocks(fill_height=True,fill_width=True) as demo:
chatbot_output = gr.Chatbot(scale=1,elem_id="chatbot",type="messages")
user_input = gr.Textbox(scale=0,show_label=False, placeholder="Enter your message...")
user_input.submit(chatbot_response, user_input, chatbot_output)
I need to build layout with 2 gr.Column() inside of gr.Row() like this:
with gr.Blocks(fill_height=True,fill_width=True) as demo:
with gr.Row():
with gr.Column(scale=0,min_width=210): # Fixed size for first column
gr.Checkbox(label="label1")
gr.Checkbox(label="label2")
with gr.Column(scale=1): # Resizable column for chatbot and input
chatbot_output = gr.Chatbot(scale=1,elem_id="chatbot",type="messages")
user_input = gr.Textbox(scale=0,show_label=False, placeholder="Enter your message...")
user_input.submit(chatbot_response, user_input, chatbot_output)
When I run this code, gr.Chatbot has a fixed height and is not dynamically scalable. it seems it uses default height (same when I use scale=0 in gr.Chatbot(). How to fix this issue and make my application to be able to scale gr.Chatbot to maximal height in browser?
I really appreciate any help/suggestion