sarahciston commited on
Commit
55c6f15
·
verified ·
1 Parent(s): 90f0f0e

add tokenizer and chat template

Browse files
Files changed (1) hide show
  1. sketch.js +5 -1
sketch.js CHANGED
@@ -24,7 +24,11 @@ async function textGenTask(input){
24
  {"role": "user", "content": input}
25
  ]
26
 
27
- var out = await pipe(messages, {
 
 
 
 
28
  max_new_tokens: 256,
29
  temperature: 0.7,
30
  do_sample: true,
 
24
  {"role": "user", "content": input}
25
  ]
26
 
27
+ const prompt = generator.tokenizer.apply_chat_template(messages, {
28
+ tokenize: false, add_generation_prompt: true,
29
+ });
30
+
31
+ var out = await pipe(prompt, {
32
  max_new_tokens: 256,
33
  temperature: 0.7,
34
  do_sample: true,