File size: 332 Bytes
ffc02c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr

def show_button(flag):
    button = gr.Button("Click Me")
    # button.visible = flag  # 控制按钮的可见性
    return "ddd"

demo = gr.Interface(
    show_button,
    "checkbox",  # 添加一个复选框组件,用于控制按钮的可见性
    "button"
)

if __name__ == "__main__":
    demo.launch()