Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,16 +7,17 @@ def hello(profile: gr.OAuthProfile | None) -> str:
|
|
| 7 |
print(profile)
|
| 8 |
if profile is None:
|
| 9 |
return "I don't know you."
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
return f"Hello {id}"
|
| 13 |
|
| 14 |
def list_organizations(oauth_token: gr.OAuthToken | None) -> str:
|
| 15 |
if oauth_token is None:
|
| 16 |
return "Please deploy this on Spaces and log in to list organizations."
|
| 17 |
print(oauth_token)
|
| 18 |
org_names = [org["name"] for org in whoami(oauth_token.token)["orgs"]]
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
with gr.Blocks() as demo:
|
| 22 |
gr.LoginButton()
|
|
|
|
| 7 |
print(profile)
|
| 8 |
if profile is None:
|
| 9 |
return "I don't know you."
|
| 10 |
+
return f"Hello {profile.name}"
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def list_organizations(oauth_token: gr.OAuthToken | None) -> str:
|
| 13 |
if oauth_token is None:
|
| 14 |
return "Please deploy this on Spaces and log in to list organizations."
|
| 15 |
print(oauth_token)
|
| 16 |
org_names = [org["name"] for org in whoami(oauth_token.token)["orgs"]]
|
| 17 |
+
|
| 18 |
+
id = whoami(oauth_token.token)['id']
|
| 19 |
+
print(id)
|
| 20 |
+
return f"Your id is {id}."
|
| 21 |
|
| 22 |
with gr.Blocks() as demo:
|
| 23 |
gr.LoginButton()
|