meet12341234 commited on
Commit
74aa1c4
·
verified ·
1 Parent(s): 25f6af0

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -1
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: "webgpu",
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
  }