Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
kk = gr.Textbox(label="S: ", lines=5)
|
12 |
-
img = gr.outputs.Image(type='numpy')
|
13 |
-
|
14 |
-
interface = gr.Interface(fn=to_black, inputs="image", outputs=[img,kk])
|
15 |
-
interface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
#输入文本处理程序
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!"
|
5 |
+
#接口创建函数
|
6 |
+
#fn设置处理函数,inputs设置输入接口组件,outputs设置输出接口组件
|
7 |
+
#fn,inputs,outputs都是必填函数
|
8 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
9 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|