Reza2kn commited on
Commit
246c049
·
verified ·
1 Parent(s): 2b3733e

Use PhaseB FP16 IOFP32 browser artifact

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.js +4 -4
__pycache__/app.cpython-311.pyc ADDED
Binary file (8.78 kB). View file
 
app.js CHANGED
@@ -1,7 +1,7 @@
1
  const MODEL_REPO = "Reza2kn/visualears-fastconformer-fa-depoisoned-phaseB-onnx-fp16";
2
- const MODEL_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_full_io.onnx";
3
- const MODEL_DATA_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_full_io_castfixed.onnx.data";
4
- const MODEL_EMBEDDED_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_full_io_embedded.onnx";
5
  const MODEL_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_FILE}`;
6
  const MODEL_DATA_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_DATA_FILE}`;
7
  const MODEL_EMBEDDED_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_EMBEDDED_FILE}`;
@@ -570,7 +570,7 @@ async function decodeUtterance(final) {
570
  const { features, frameCount } = pcmToLogMel(audio);
571
  const ort = state.ort || ortRuntime;
572
  if (!ort) throw new Error("ONNX Runtime Web did not initialize");
573
- const tensor = new ort.Tensor("float16", float32ArrayToFloat16Bits(features), [1, N_MELS, FIXED_FRAMES]);
574
  const lengthTensor = new ort.Tensor("int64", BigInt64Array.from([BigInt(frameCount)]), [1]);
575
  const inferStarted = performance.now();
576
  const output = await state.session.run({ processed_signal: tensor, processed_signal_length: lengthTensor });
 
1
  const MODEL_REPO = "Reza2kn/visualears-fastconformer-fa-depoisoned-phaseB-onnx-fp16";
2
+ const MODEL_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_iofp32.onnx";
3
+ const MODEL_DATA_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_iofp32.onnx.data";
4
+ const MODEL_EMBEDDED_FILE = "fastconformer_phaseB_ctc_fixed2005_len_fp16_iofp32_embedded.onnx";
5
  const MODEL_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_FILE}`;
6
  const MODEL_DATA_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_DATA_FILE}`;
7
  const MODEL_EMBEDDED_URL = `https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_EMBEDDED_FILE}`;
 
570
  const { features, frameCount } = pcmToLogMel(audio);
571
  const ort = state.ort || ortRuntime;
572
  if (!ort) throw new Error("ONNX Runtime Web did not initialize");
573
+ const tensor = new ort.Tensor("float32", features, [1, N_MELS, FIXED_FRAMES]);
574
  const lengthTensor = new ort.Tensor("int64", BigInt64Array.from([BigInt(frameCount)]), [1]);
575
  const inferStarted = performance.now();
576
  const output = await state.session.run({ processed_signal: tensor, processed_signal_length: lengthTensor });