0
点赞
收藏
分享

微信扫一扫

Gradio学习(五)—————学习一下布局Column的使用


今天学一下布局
非常简单row就是行column就是列
如下就是两行两列
scale就是缩放比例,如下按钮类scale=4,而文本框类scale=1,按钮类显示宽度就是文本框类宽度的四倍

import gradio as gr
with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column(scale=1):
            text1 = gr.Textbox()
            text2 = gr.Textbox()
        with gr.Column(scale=4):
            btn1 = gr.Button("Button 1")
            btn2 = gr.Button("Button 2")
    with gr.Row():
        with gr.Column(scale=1):
            text11 = gr.Textbox()
            text22 = gr.Textbox()
        with gr.Column(scale=4):
            btn11 = gr.Button("Button 1")
            btn22 = gr.Button("Button 2")

demo.launch()


举报

相关推荐

0 条评论