Update index.js
Browse files
index.js
CHANGED
|
@@ -19,6 +19,7 @@ async function loadModel() {
|
|
| 19 |
}
|
| 20 |
if (!model) {
|
| 21 |
showLoader('Loading model weights (this may take a while)...');
|
|
|
|
| 22 |
model = await VoxtralForConditionalGeneration.from_pretrained(
|
| 23 |
model_id,
|
| 24 |
{
|
|
@@ -27,7 +28,7 @@ async function loadModel() {
|
|
| 27 |
audio_encoder: "q4",
|
| 28 |
decoder_model_merged: "q4",
|
| 29 |
},
|
| 30 |
-
device
|
| 31 |
},
|
| 32 |
);
|
| 33 |
}
|
|
|
|
| 19 |
}
|
| 20 |
if (!model) {
|
| 21 |
showLoader('Loading model weights (this may take a while)...');
|
| 22 |
+
const device = (navigator.gpu) ? "webgpu" : "wasm";
|
| 23 |
model = await VoxtralForConditionalGeneration.from_pretrained(
|
| 24 |
model_id,
|
| 25 |
{
|
|
|
|
| 28 |
audio_encoder: "q4",
|
| 29 |
decoder_model_merged: "q4",
|
| 30 |
},
|
| 31 |
+
device,
|
| 32 |
},
|
| 33 |
);
|
| 34 |
}
|