liyaoshi commited on
Commit
6c00950
·
verified ·
1 Parent(s): be827cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -9,12 +9,14 @@ def hello(profile: gr.OAuthProfile | None) -> str:
9
  return "I don't know you."
10
  return f"Hello {profile.name}"
11
 
12
- def message(message,history,profile: gr.OAuthProfile | None,oauth_token: gr.OAuthToken | None):
 
13
  if profile is None:
14
  raise gr.Error('Click "Sign in with Hugging Face" to continue')
15
  else:
16
  print(profile)
17
  print(f'oauth token: {oauth_token.token}')
 
18
  return f"hello {profile.name}"
19
 
20
  def list_private_models(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthToken | None) -> str:
 
9
  return "I don't know you."
10
  return f"Hello {profile.name}"
11
 
12
+ def message(message,history,profile: gr.OAuthProfile | None,oauth_token: gr.OAuthToken | None, request: gr.Request):
13
+ print(request.client.host)
14
  if profile is None:
15
  raise gr.Error('Click "Sign in with Hugging Face" to continue')
16
  else:
17
  print(profile)
18
  print(f'oauth token: {oauth_token.token}')
19
+
20
  return f"hello {profile.name}"
21
 
22
  def list_private_models(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthToken | None) -> str: