login-to-render / app_wrapper.py
hysts's picture
hysts HF Staff
Update
c5b2981
raw
history blame contribute delete
421 Bytes
#!/usr/bin/env python
import gradio as gr
from app import demo as main_demo
def render(profile: gr.OAuthProfile | None) -> dict:
return gr.Column(visible=profile is not None)
with gr.Blocks() as demo:
gr.LoginButton()
with gr.Column(visible=False) as col:
main_demo.render()
demo.load(fn=render, outputs=col)
if __name__ == "__main__":
demo.queue(api_open=False).launch(show_api=False)