Spaces:
Running
Running
add tokenizer and chat template
Browse files
sketch.js
CHANGED
|
@@ -24,7 +24,11 @@ async function textGenTask(input){
|
|
| 24 |
{"role": "user", "content": input}
|
| 25 |
]
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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,
|