Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,18 +6,20 @@ def greet(name):
|
|
6 |
|
7 |
def hello(profile: gr.OAuthProfile | None) -> str:
|
8 |
if profile is None:
|
9 |
-
return (
|
10 |
-
'# ePub summarization tool'
|
11 |
'<p style="text-align: center;">Login to access the tool.</p>'
|
12 |
)
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
16 |
|
17 |
|
18 |
with gr.Blocks() as demo:
|
19 |
-
|
20 |
-
|
21 |
gr.LoginButton()
|
22 |
-
|
|
|
23 |
demo.launch()
|
|
|
6 |
|
7 |
def hello(profile: gr.OAuthProfile | None) -> str:
|
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 |
+
gr.Blocks().attach_load_event(hello, None)
|
21 |
+
if gr.OAuthProfile is None:
|
22 |
gr.LoginButton()
|
23 |
+
else:
|
24 |
+
gr.LogoutButton()
|
25 |
demo.launch()
|