Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,10 @@ from epub2txt import epub2txt
|
|
| 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()
|
| 10 |
|
| 11 |
def process(self, file):
|
|
@@ -19,15 +21,10 @@ class GUI:
|
|
| 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)
|
|
|
|
| 4 |
class GUI:
|
| 5 |
def __init__(self, *args, **kwargs):
|
| 6 |
with gr.Blocks(css=".lbtn {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 |
demo.launch()
|
| 12 |
|
| 13 |
def process(self, file):
|
|
|
|
| 21 |
|
| 22 |
def hello(self, profile: gr.OAuthProfile | None):
|
| 23 |
if profile is None:
|
|
|
|
|
|
|
| 24 |
return (
|
| 25 |
'# ePub summarization tool '
|
| 26 |
'<p style="text-align: center;">Login to access the tool.</p>'
|
| 27 |
)
|
|
|
|
|
|
|
|
|
|
| 28 |
inp = gr.File(file_types=['.epub'])
|
| 29 |
inp.change(self.process, inp, self.out)
|
| 30 |
return self.greet(profile.name)
|