gradio-oauth / app.py
Wauplin's picture
Wauplin HF staff
switch to Docker Space
e464d27
raw
history blame
No virus
333 Bytes
import gradio as gr
from typing import Optional
def hello(profile: Optional[gr.OAuthProfile]) -> str:
if profile is None:
return "I don't know you."
return f"Hello {profile.name}"
with gr.Blocks() as demo:
gr.LoginButton()
gr.LogoutButton()
gr.Markdown().attach_load_event(hello, None)
demo.launch()