BookSumBeta / app.py
npc0's picture
Update app.py
cb8de88
raw
history blame
640 Bytes
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 '
'<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:
gr.Blocks().attach_load_event(hello, None)
if gr.OAuthProfile is None:
gr.LoginButton()
else:
gr.LogoutButton()
demo.launch()