changxin commited on
Commit
32f7809
1 Parent(s): c3e2bd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -2,12 +2,8 @@ import gradio as gr
2
  user_db={"admin":"admin","foo":"bar"}
3
  def fx(x:str):
4
  return '欢迎浏览:'+x
5
- demo = gr.Blocks()
6
- with demo:
7
- gr.Dataframe(headers=['项目','数据'],interactive=True)
8
- text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入测试内容")
9
- bt=gr.Button("运行")
10
- bt.click(fx, inputs=text_input, outputs=gr.Textbox(label="输出"))
11
-
12
  demo.launch(auth=lambda a,b:user_db.get(a)==b,auth_message="欢迎使用本web app")
13
 
 
2
  user_db={"admin":"admin","foo":"bar"}
3
  def fx(x:str):
4
  return '欢迎浏览:'+x
5
+ gr.Dataframe(headers=['项目','数据'],interactive=True)
6
+ text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入测试内容")
7
+ demo=gr.Interface(fx, inputs=text_input, outputs=gr.Textbox(label="输出"))
 
 
 
 
8
  demo.launch(auth=lambda a,b:user_db.get(a)==b,auth_message="欢迎使用本web app")
9