npc0 commited on
Commit
da9769b
1 Parent(s): cbb2a58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -3,7 +3,7 @@ from epub2txt import epub2txt
3
 
4
  class GUI:
5
  def __init__(self, *args, **kwargs):
6
- with gr.Blocks() as demo:
7
  self.out = gr.Markdown().attach_load_event(self.hello, None)
8
 
9
  demo.launch()
@@ -19,17 +19,15 @@ class GUI:
19
 
20
  def hello(self, profile: gr.OAuthProfile | None):
21
  if profile is None:
22
- with gr.Blocks(css=".lbtn {float: right;}") as demo:
23
- with gr.Row():
24
- gr.LoginButton(elem_classes="lbtn")
25
  return (
26
  '# ePub summarization tool '
27
  '<p style="text-align: center;">Login to access the tool.</p>'
28
  )
29
- with gr.Blocks(css=".lbtn {float: right;}") as demo:
30
- with gr.Row():
31
- gr.LoginButton(elem_classes="lbtn")
32
- gr.LogoutButton(elem_classes="lbtn")
33
  inp = gr.File(file_types=['.epub'])
34
  inp.change(self.process, inp, self.out)
35
  return self.greet(profile.name)
 
3
 
4
  class GUI:
5
  def __init__(self, *args, **kwargs):
6
+ with gr.Blocks(css=".lbtn {float: right;}") as demo:
7
  self.out = gr.Markdown().attach_load_event(self.hello, None)
8
 
9
  demo.launch()
 
19
 
20
  def hello(self, profile: gr.OAuthProfile | None):
21
  if profile is None:
22
+ with gr.Row():
23
+ gr.LoginButton(elem_classes="lbtn")
 
24
  return (
25
  '# ePub summarization tool '
26
  '<p style="text-align: center;">Login to access the tool.</p>'
27
  )
28
+ with gr.Row():
29
+ gr.LoginButton(elem_classes="lbtn")
30
+ gr.LogoutButton(elem_classes="lbtn")
 
31
  inp = gr.File(file_types=['.epub'])
32
  inp.change(self.process, inp, self.out)
33
  return self.greet(profile.name)