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


def hello_world(name, request: gr.Request):
    return f'Hello {name}!'


def hello_world_tab():
    with gr.Tab("hello world!"):
        with gr.Row():
            text_input = gr.Textbox(label='姓名', placeholder='请输入你的姓名')
            text_output = gr.Textbox(label="结果", lines=10)
        text_button = gr.Button('hello world')

    text_button.click(hello_world, inputs=text_input, outputs=text_output)