npc0 commited on
Commit
9f8e6cc
·
1 Parent(s): 362dc0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -3,11 +3,11 @@ from epub2txt import epub2txt
3
 
4
  class GUI:
5
  def __init__(self, *args, **kwargs):
6
- with gr.Blocks(css=".lbtn {position: relative; float: right;}") as demo:
7
  with gr.Row():
8
- gr.LoginButton(elem_classes="lbtn")
9
- gr.LogoutButton(elem_classes="lbtn")
10
- self.out = gr.Markdown().attach_load_event(self.hello, None)
11
  inp = gr.File(file_types=['.epub'])
12
  inp.change(self.process, inp, self.out)
13
  demo.launch()
@@ -16,7 +16,9 @@ class GUI:
16
  ch_list = epub2txt(file, outputlist=True)
17
  chapter_titles = epub2txt.content_titles
18
  title = epub2txt.title
19
- return f"# {title}\n\n" + "\n\n".join([f"## {ct}\n\n{c}" for ct, c in zip(chapter_titles, ch_list)])
 
 
20
 
21
  def greet(self, name):
22
  return "Hello " + name + "!!"
 
3
 
4
  class GUI:
5
  def __init__(self, *args, **kwargs):
6
+ with gr.Blocks() as demo:
7
  with gr.Row():
8
+ self.out = gr.Markdown(scale=2).attach_load_event(self.hello, None)
9
+ gr.LoginButton()
10
+ gr.LogoutButton()
11
  inp = gr.File(file_types=['.epub'])
12
  inp.change(self.process, inp, self.out)
13
  demo.launch()
 
16
  ch_list = epub2txt(file, outputlist=True)
17
  chapter_titles = epub2txt.content_titles
18
  title = epub2txt.title
19
+ return gr.Update(
20
+ f"# {title}\n\n" + "\n\n".join(
21
+ [f"## {ct}\n\n{c}" for ct, c in zip(chapter_titles, ch_list)]))
22
 
23
  def greet(self, name):
24
  return "Hello " + name + "!!"