import gradio as gr def greet(name): return "Hello " + name + "!!" def hello(profile: gr.OAuthProfile | None) -> str: if profile is None: return gr.Markdown( '# ePub summarization tool ' '

Login to access the tool.

' ) 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: gr.Blocks().attach_load_event(hello, None) if gr.OAuthProfile is None: gr.LoginButton() else: gr.LogoutButton() demo.launch()