Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -103,13 +103,13 @@ with gr.Blocks(title="Gemini → HF Space scaffolder") as demo:
|
|
103 |
login_btn = gr.LoginButton(variant="huggingface", size="lg") # displays "Sign in with Hugging Face"
|
104 |
status_md = gr.Markdown("*Not logged in.*")
|
105 |
|
106 |
-
#
|
107 |
def show_profile(profile: gr.OAuthProfile | None) -> str:
|
108 |
return "*Not logged in.*" if profile is None else f"Logged in as **{profile.username}**"
|
109 |
|
110 |
-
# Trigger on page load and
|
111 |
-
demo.load(fn=show_profile, inputs=
|
112 |
-
login_btn.click(fn=show_profile, inputs=
|
113 |
|
114 |
with gr.Row():
|
115 |
with gr.Column(scale=1):
|
|
|
103 |
login_btn = gr.LoginButton(variant="huggingface", size="lg") # displays "Sign in with Hugging Face"
|
104 |
status_md = gr.Markdown("*Not logged in.*")
|
105 |
|
106 |
+
# 2) show_profile called on load & login/logout
|
107 |
def show_profile(profile: gr.OAuthProfile | None) -> str:
|
108 |
return "*Not logged in.*" if profile is None else f"Logged in as **{profile.username}**"
|
109 |
|
110 |
+
# Trigger on page load and when login button is clicked
|
111 |
+
demo.load(fn=show_profile, inputs=None, outputs=[status_md])
|
112 |
+
login_btn.click(fn=show_profile, inputs=None, outputs=[status_md])
|
113 |
|
114 |
with gr.Row():
|
115 |
with gr.Column(scale=1):
|