File size: 691 Bytes
04dd1b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# import gradio as gr
# from gradio import components as grcomp
#
# def greet(name):
#     return f"Hello, {name}!"
#
# input_text = grcomp.Textbox(lines=1, label="输入姓名")
# output_text = grcomp.Textbox(label="问候")
#
# iface = gr.Interface(fn=greet, inputs=input_text, outputs=output_text, title="问候程序")
# iface.launch(share=True)

import gradio as gr
from  gradio import  components as grcomp

def greet(name):
    return  f"Hello ,{name}!"

input_text = grcomp.Textbox(lines=1,label="输入姓名")
output_text = grcomp.Textbox(lines=1,label="问候")

iface = gr.Interface(fn=greet, inputs=input_text,outputs=output_text,title="问候程序")

iface.launch(share=True)