changxin commited on
Commit
12e6a54
1 Parent(s): d9217c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,8 +1,11 @@
1
  import gradio as gr
2
  def fx(x:str):
3
  return '欢迎浏览:'+x
4
- gr.Dataframe(headers=['项目','数据'],interactive=True)
5
- text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入测试内容")
6
- demo=gr.Interface(fx, inputs=text_input, outputs=gr.Textbox(label="输出"))
 
 
 
7
  demo.launch()
8
 
 
1
  import gradio as gr
2
  def fx(x:str):
3
  return '欢迎浏览:'+x
4
+ demo=gr.Block()
5
+ with demo:
6
+ gr.Dataframe(headers=['项目','数据'],interactive=True)
7
+ text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入测试内容")
8
+ bb_button=gr.Button("运行")
9
+ bb_button.Click(fx, inputs=text_input, outputs=gr.Textbox(label="输出"))
10
  demo.launch()
11