fudii0921 commited on
Commit
ef5979a
·
verified ·
1 Parent(s): 91589f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -20,7 +20,7 @@ cohere_client = cohere.Client(api_key=os.environ.get("COHERE_API_KEY"))
20
  co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
21
 
22
 
23
- # OAuthProfile example
24
  class OAuthProfile:
25
  def __init__(self, name, username, profile, picture):
26
  self.name = name
@@ -33,7 +33,7 @@ oauth_profile = OAuthProfile(
33
  username="",
34
  profile="",
35
  picture=""
36
- )
37
 
38
 
39
  def greeting(profile: gr.OAuthProfile | None) -> str:
@@ -64,12 +64,13 @@ def list_private_models(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthTo
64
  print("pic:",state.value["picture"],profile.picture)
65
  print("login-user:",state.value["loginuser"],userinfo)
66
 
 
67
  oauth_profile = OAuthProfile(
68
  name=profile.name,
69
  username=profile.username,
70
  profile=profile.profile,
71
  picture=profile.picture
72
- )
73
 
74
  #return profile.username, gr.update(visible=True), gr.update(visible=True) #, gr.update(visible=True)
75
  return userinfo, gr.update(visible=True), gr.update(visible=True) #, gr.update(visible=True)
@@ -236,7 +237,7 @@ with gr.Blocks(css="footer {visibility: hidden;} .custom-image {width: 64px; hei
236
 
237
 
238
  with gr.Sidebar(open=False):
239
- gr.Image(value=oauth_profile.picture, elem_classes=["custom-image"])
240
  gr.HTML("""
241
  <!DOCTYPE html>
242
  <html lang="ja">
 
20
  co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
21
 
22
 
23
+ '''# OAuthProfile example
24
  class OAuthProfile:
25
  def __init__(self, name, username, profile, picture):
26
  self.name = name
 
33
  username="",
34
  profile="",
35
  picture=""
36
+ )'''
37
 
38
 
39
  def greeting(profile: gr.OAuthProfile | None) -> str:
 
64
  print("pic:",state.value["picture"],profile.picture)
65
  print("login-user:",state.value["loginuser"],userinfo)
66
 
67
+ '''global oauth_profile
68
  oauth_profile = OAuthProfile(
69
  name=profile.name,
70
  username=profile.username,
71
  profile=profile.profile,
72
  picture=profile.picture
73
+ )'''
74
 
75
  #return profile.username, gr.update(visible=True), gr.update(visible=True) #, gr.update(visible=True)
76
  return userinfo, gr.update(visible=True), gr.update(visible=True) #, gr.update(visible=True)
 
237
 
238
 
239
  with gr.Sidebar(open=False):
240
+ #gr.Image(value=oauth_profile.picture, elem_classes=["custom-image"])
241
  gr.HTML("""
242
  <!DOCTYPE html>
243
  <html lang="ja">