zwq2018 commited on
Commit
ee03ae2
1 Parent(s): 0a1f388

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -1,15 +1,9 @@
1
  import gradio as gr
2
- import cv2
3
- import os
4
-
5
- def to_black(image):
6
- output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
7
- key = os.getenv("TUSHARE_TOKEN")
8
- return output, key
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()