File size: 574 Bytes
615f98d
 
 
 
 
 
 
 
98947d1
 
 
 
615f98d
 
 
 
 
 
98947d1
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr

def greet(name):
    return "Hello " + name + "!!"


def hello(profile: gr.OAuthProfile | None) -> str:
    if profile is None:
        return (
            '# ePub summarization tool'
            '<p style="text-align: center;">Login to access the tool.</p>'
        )
    iface = gr.Interface(fn=greet, inputs="text", outputs="text")
    iface.launch()
    return f"Hello {profile.name}"


with gr.Blocks() as demo:
    with gr.Column(scale=1):
        gr.Markdown().attach_load_event(hello, None)
        gr.LoginButton()
        # gr.LogoutButton()