npc0 commited on
Commit
615f98d
1 Parent(s): 6c43a13

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+
7
+ def hello(profile: gr.OAuthProfile | None) -> str:
8
+ if profile is None:
9
+ return "I don't know you."
10
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
11
+ iface.launch()
12
+ return f"Hello {profile.name}"
13
+
14
+
15
+ with gr.Blocks() as demo:
16
+ gr.LoginButton()
17
+ gr.LogoutButton()
18
+ gr.Markdown().attach_load_event(hello, None)