Sarah Ciston commited on
Commit
d6278d0
·
1 Parent(s): d1e60b6

add token to model call, change call to text gen

Browse files
Files changed (3) hide show
  1. README.md +2 -2
  2. sketch.js +4 -2
  3. tutorial.md +18 -1
README.md CHANGED
@@ -12,8 +12,8 @@ hf_oauth_scopes:
12
  models:
13
  # - gpt-3.5-turbo
14
  # - Xenova/distilgpt2
15
- - HuggingFaceH4/zephyr-7b-beta
16
- - openai-community/gpt2
17
  # - meta-llama/Meta-Llama-3-70B-Instruct
18
  # - Xenova/detr-resnet-50
19
  # - Xenova/gpt2
 
12
  models:
13
  # - gpt-3.5-turbo
14
  # - Xenova/distilgpt2
15
+ - HuggingFaceH4/zephyr-7b-gemma-v0.1
16
+ # - openai-community/gpt2
17
  # - meta-llama/Meta-Llama-3-70B-Instruct
18
  # - Xenova/detr-resnet-50
19
  # - Xenova/gpt2
sketch.js CHANGED
@@ -12,8 +12,9 @@ if (!oauthResult) {
12
  }
13
 
14
  // You can use oauthResult.accessToken, oauthResult.accessTokenExpiresAt and oauthResult.userInfo
15
- console.log(oauthResult);
16
  const HF_TOKEN = oauthResult.accessToken
 
17
 
18
  // import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
19
  // import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
@@ -222,8 +223,9 @@ new p5(function (p5) {
222
  async function runModel(PREPROMPT, PROMPT){
223
  // inference API version, not working in spaces
224
 
225
- let MODELNAME = 'mistralai/Mistral-Nemo-Instruct-2407'
226
  // let MODELNAME = "openai-community/gpt2"
 
227
 
228
  let out = await inference.chatCompletion({
229
  model: MODELNAME,
 
12
  }
13
 
14
  // You can use oauthResult.accessToken, oauthResult.accessTokenExpiresAt and oauthResult.userInfo
15
+ // console.log(oauthResult);
16
  const HF_TOKEN = oauthResult.accessToken
17
+ console.log(HF_TOKEN)
18
 
19
  // import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
20
  // import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
 
223
  async function runModel(PREPROMPT, PROMPT){
224
  // inference API version, not working in spaces
225
 
226
+ let MODELNAME = "HuggingFaceH4/zephyr-7b-gemma-v0.1"
227
  // let MODELNAME = "openai-community/gpt2"
228
+ // let MODELNAME = 'mistral_inference'
229
 
230
  let out = await inference.chatCompletion({
231
  model: MODELNAME,
tutorial.md CHANGED
@@ -198,4 +198,21 @@ window.onload = function(){
198
  console.log('DOM loaded, sketch.js loaded')
199
  }
200
 
201
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  console.log('DOM loaded, sketch.js loaded')
199
  }
200
 
201
+ ```
202
+
203
+ #### X. Add authorization to your space.
204
+
205
+ <!-- https://huggingface.co/docs/huggingface.js/hub/README#oauth-login -->
206
+ <!-- https://huggingface.co/spaces/huggingfacejs/client-side-oauth/blob/main/index.html -->
207
+
208
+ Paste this code into your `sketch.js` file.
209
+
210
+ Also add this to your `README.md`.
211
+
212
+ When you next load your app, click `Authorize`
213
+
214
+ ![screenshot of Hugging Face app authorization screen]()
215
+
216
+ To check if your authorization has worked, visit the Settings for your Hugging Face profile. Click `Connected Apps` and you should see the name of your `Space`.
217
+
218
+ ![screenshot of authorized space in Hugging Face Settings interface]()