Sarah Ciston commited on
Commit
ed7071e
·
1 Parent(s): f086ae3

remove chat_template

Browse files
Files changed (1) hide show
  1. sketch.js +8 -8
sketch.js CHANGED
@@ -177,7 +177,7 @@ async function runModel(PREPROMPT, PROMPT){
177
  // pipeline/transformers version
178
  // let pipe = await pipeline('text-generation', 'Xenova/distilgpt2');
179
  // seems to work with default model distilgpt2 ugh
180
- let pipe = pipeline('chat-completion', "HuggingFaceH4/zephyr-7b-beta")
181
 
182
  // IMPORTANT: different models have different input/output structures for their API so look to the samples and references on the specific model page for help :)
183
 
@@ -193,13 +193,13 @@ async function runModel(PREPROMPT, PROMPT){
193
  // num_return_sequences: 1 //must be 1 for greedy search
194
  // })
195
 
196
- // for zephyr customizing
197
- let prompt = pipe.tokenizer.apply_chat_template(inputs, {
198
- tokenize: false,
199
- add_generation_prompt: true
200
- })
201
 
202
- let out = await pipe(prompt, {
203
  // max_new_tokens: 256,
204
  // do_sample: true,
205
  "return_full_text": false,
@@ -251,7 +251,7 @@ async function runModel(PREPROMPT, PROMPT){
251
  // num_return_sequences: 1
252
  // });
253
 
254
-
255
 
256
  // var PROMPT = `The [BLANK] works as a [blank] but wishes for [blank].`
257
  // /// this needs to run on button click, use string variables to blank in the form
 
177
  // pipeline/transformers version
178
  // let pipe = await pipeline('text-generation', 'Xenova/distilgpt2');
179
  // seems to work with default model distilgpt2 ugh
180
+ let pipe = pipeline('text-generation', "HuggingFaceH4/zephyr-7b-beta")
181
 
182
  // IMPORTANT: different models have different input/output structures for their API so look to the samples and references on the specific model page for help :)
183
 
 
193
  // num_return_sequences: 1 //must be 1 for greedy search
194
  // })
195
 
196
+ // DID NOT WORK for zephyr customizing
197
+ // let prompt = pipe.tokenizer.apply_chat_template(inputs, {
198
+ // tokenize: false,
199
+ // add_generation_prompt: true
200
+ // })
201
 
202
+ let out = await pipe(inputs, {
203
  // max_new_tokens: 256,
204
  // do_sample: true,
205
  "return_full_text": false,
 
251
  // num_return_sequences: 1
252
  // });
253
 
254
+ // Must be one of [text-classification,token-classification,question-answering,fill-mask,summarization,translation,text2text-generation,text-generation,zero-shot-classification,audio-classification,zero-shot-audio-classification,automatic-speech-recognition,text-to-audio,image-to-text,image-classification,image-segmentation,zero-shot-image-classification,object-detection,zero-shot-object-detection,document-question-answering,image-to-image,depth-estimation,feature-extraction]
255
 
256
  // var PROMPT = `The [BLANK] works as a [blank] but wishes for [blank].`
257
  // /// this needs to run on button click, use string variables to blank in the form