Spaces:
Sleeping
Sleeping
import gradio as gr | |
def greet(name): | |
return "Hello " + name + "!!" | |
def hello(profile: gr.OAuthProfile | None): | |
if profile is None: | |
return gr.Markdown( | |
'# ePub summarization tool ' | |
'<p style="text-align: center;">Login to access the tool.</p>' | |
) | |
with gr.Blocks() as iface: | |
gr.Markdown(f"Hello {profile.name}") | |
gr.Interface(fn=greet, inputs="text", outputs="text") | |
return iface | |
with gr.Blocks() as demo: | |
hello() | |
with gr.Row(): | |
gr.LoginButton() | |
if gr.OAuthProfile is not None: | |
gr.LogoutButton() | |
demo.launch() |