npc0 commited on
Commit
2c3f6d8
·
1 Parent(s): 6d7c8c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -4,22 +4,20 @@ def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
 
7
- def hello(profile = gr.OAuthProfile):
8
  if profile is None:
9
  return gr.Markdown(
10
  '# ePub summarization tool '
11
  '<p style="text-align: center;">Login to access the tool.</p>'
12
  )
13
- with gr.Blocks() as iface:
14
- gr.Markdown(f"Hello {profile.name}")
15
- gr.Interface(fn=greet, inputs="text", outputs="text")
16
- return iface
17
 
18
 
19
  with gr.Blocks() as demo:
20
- hello()
21
  with gr.Row():
22
  gr.LoginButton()
23
- if gr.OAuthProfile is not None:
24
- gr.LogoutButton()
 
 
25
  demo.launch()
 
4
  return "Hello " + name + "!!"
5
 
6
 
7
+ def hello(profile: gr.OAuthProfile | None):
8
  if profile is None:
9
  return gr.Markdown(
10
  '# ePub summarization tool '
11
  '<p style="text-align: center;">Login to access the tool.</p>'
12
  )
13
+ return f"Hello {profile.name}"
 
 
 
14
 
15
 
16
  with gr.Blocks() as demo:
 
17
  with gr.Row():
18
  gr.LoginButton()
19
+ gr.LogoutButton()
20
+ gr.File()
21
+ gr.Markdown().attach_load_event(hello, None)
22
+
23
  demo.launch()