Spaces:
Running
Running
Update src/worker.js
Browse files- src/worker.js +4 -5
src/worker.js
CHANGED
@@ -29,7 +29,7 @@ import {
|
|
29 |
const model_id = "onnx-community/Kokoro-82M-v1.0-ONNX";
|
30 |
let voice;
|
31 |
const tts = await KokoroTTS.from_pretrained(model_id, {
|
32 |
-
dtype: "
|
33 |
device: "webgpu",
|
34 |
});
|
35 |
|
@@ -78,17 +78,16 @@ const transcriber = await pipeline(
|
|
78 |
await transcriber(new Float32Array(INPUT_SAMPLE_RATE)); // Compile shaders
|
79 |
|
80 |
const llm_model_id = "onnx-community/Qwen3-1.7B-ONNX";
|
81 |
-
const tokenizer = await AutoTokenizer.from_pretrained(
|
82 |
const llm = await AutoModelForCausalLM.from_pretrained(llm_model_id, {
|
83 |
-
dtype: "q4f16",
|
84 |
device: "webgpu",
|
85 |
-
// Don't specify model_file_name - let Transformers.js construct the path
|
86 |
});
|
87 |
|
88 |
const SYSTEM_MESSAGE = {
|
89 |
role: "system",
|
90 |
content:
|
91 |
-
"You're a helpful and conversational voice assistant
|
92 |
};
|
93 |
await llm.generate({ ...tokenizer("x"), max_new_tokens: 1 }); // Compile shaders
|
94 |
|
|
|
29 |
const model_id = "onnx-community/Kokoro-82M-v1.0-ONNX";
|
30 |
let voice;
|
31 |
const tts = await KokoroTTS.from_pretrained(model_id, {
|
32 |
+
dtype: "fp32",
|
33 |
device: "webgpu",
|
34 |
});
|
35 |
|
|
|
78 |
await transcriber(new Float32Array(INPUT_SAMPLE_RATE)); // Compile shaders
|
79 |
|
80 |
const llm_model_id = "onnx-community/Qwen3-1.7B-ONNX";
|
81 |
+
const tokenizer = await AutoTokenizer.from_pretrained(llm_model_id);
|
82 |
const llm = await AutoModelForCausalLM.from_pretrained(llm_model_id, {
|
83 |
+
dtype: "q4f16",
|
84 |
device: "webgpu",
|
|
|
85 |
});
|
86 |
|
87 |
const SYSTEM_MESSAGE = {
|
88 |
role: "system",
|
89 |
content:
|
90 |
+
"You're a helpful and conversational voice assistant. Keep your responses short, clear, and casual.",
|
91 |
};
|
92 |
await llm.generate({ ...tokenizer("x"), max_new_tokens: 1 }); // Compile shaders
|
93 |
|