Sarah Ciston commited on
Commit
a019ddd
·
1 Parent(s): 0cae0a3

try again w oauth order in readme and hf hubs version

Browse files
Files changed (2) hide show
  1. README.md +4 -3
  2. sketch.js +4 -3
README.md CHANGED
@@ -5,14 +5,15 @@ colorFrom: purple
5
  colorTo: blue
6
  sdk: static
7
  pinned: false
 
 
 
8
  hf_oauth: true
9
  hf_oauth_scopes:
10
  - read-repos
11
  - write-repos
12
  - inference-api
13
- models:
14
- - bert-base-uncased
15
- - distilroberta-base
16
 
17
  ---
18
 
 
5
  colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ models:
9
+ - bert-base-uncased
10
+ - distilroberta-base
11
  hf_oauth: true
12
  hf_oauth_scopes:
13
  - read-repos
14
  - write-repos
15
  - inference-api
16
+
 
 
17
 
18
  ---
19
 
sketch.js CHANGED
@@ -5,7 +5,7 @@ import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers
5
 
6
  /// AUTHORIZATION
7
  // import { textGeneration } from 'https://esm.sh/@huggingface/inference';
8
- import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://esm.sh/@huggingface/hub';
9
 
10
  const oauthResult = await oauthHandleRedirectIfPresent();
11
 
@@ -16,8 +16,9 @@ if (!oauthResult) {
16
 
17
  // You can use oauthResult.accessToken, oauthResult.accessTokenExpiresAt and oauthResult.userInfo
18
  // console.log(oauthResult);
19
- const HF_TOKEN = oauthResult.accessToken
20
- console.log(HF_TOKEN)
 
21
 
22
  // import { HfInference } from 'https://esm.sh/@huggingface/inference';
23
  // const inference = new HfInference(HF_TOKEN);
 
5
 
6
  /// AUTHORIZATION
7
  // import { textGeneration } from 'https://esm.sh/@huggingface/inference';
8
+ import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://esm.sh/@huggingface/hub@0.15.1';
9
 
10
  const oauthResult = await oauthHandleRedirectIfPresent();
11
 
 
16
 
17
  // You can use oauthResult.accessToken, oauthResult.accessTokenExpiresAt and oauthResult.userInfo
18
  // console.log(oauthResult);
19
+ // window.huggingface.variables.OAUTH_CLIENT_SECRET
20
+ // const HF_TOKEN = oauthResult.accessToken
21
+ // console.log(HF_TOKEN)
22
 
23
  // import { HfInference } from 'https://esm.sh/@huggingface/inference';
24
  // const inference = new HfInference(HF_TOKEN);