Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 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 |
-
|
| 9 |
-
demo.launch(auth=lambda a,b:user_db.get(a)==b,auth_message="欢迎使用本web app")
|
| 10 |
|
|
|
|
| 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 |
|