Commit ·
04dd1b8
1
Parent(s): 12301a7
test001
Browse files
main.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# import gradio as gr
|
| 2 |
+
# from gradio import components as grcomp
|
| 3 |
+
#
|
| 4 |
+
# def greet(name):
|
| 5 |
+
# return f"Hello, {name}!"
|
| 6 |
+
#
|
| 7 |
+
# input_text = grcomp.Textbox(lines=1, label="输入姓名")
|
| 8 |
+
# output_text = grcomp.Textbox(label="问候")
|
| 9 |
+
#
|
| 10 |
+
# iface = gr.Interface(fn=greet, inputs=input_text, outputs=output_text, title="问候程序")
|
| 11 |
+
# iface.launch(share=True)
|
| 12 |
+
|
| 13 |
+
import gradio as gr
|
| 14 |
+
from gradio import components as grcomp
|
| 15 |
+
|
| 16 |
+
def greet(name):
|
| 17 |
+
return f"Hello ,{name}!"
|
| 18 |
+
|
| 19 |
+
input_text = grcomp.Textbox(lines=1,label="输入姓名")
|
| 20 |
+
output_text = grcomp.Textbox(lines=1,label="问候")
|
| 21 |
+
|
| 22 |
+
iface = gr.Interface(fn=greet, inputs=input_text,outputs=output_text,title="问候程序")
|
| 23 |
+
|
| 24 |
+
iface.launch(share=True)
|