Commit
·
4675fdf
1
Parent(s):
8eb12e1
update model
Browse files- sherpa-onnx-asr.js +8 -2
- sherpa-onnx-wasm-main-asr.js +0 -0
sherpa-onnx-asr.js
CHANGED
|
@@ -280,7 +280,7 @@ function initSherpaOnnxOnlineRecognizerConfig(config, Module) {
|
|
| 280 |
const ctcFstDecoder = initSherpaOnnxOnlineCtcFstDecoderConfig(
|
| 281 |
config.ctcFstDecoderConfig, Module)
|
| 282 |
|
| 283 |
-
const len = feat.len + model.len + 8 * 4 + ctcFstDecoder.len +
|
| 284 |
const ptr = Module._malloc(len);
|
| 285 |
|
| 286 |
let offset = 0;
|
|
@@ -351,6 +351,9 @@ function initSherpaOnnxOnlineRecognizerConfig(config, Module) {
|
|
| 351 |
buffer + decodingMethodLen + hotwordsFileLen + ruleFstsFileLen, 'i8*');
|
| 352 |
offset += 4;
|
| 353 |
|
|
|
|
|
|
|
|
|
|
| 354 |
return {
|
| 355 |
buffer: buffer, ptr: ptr, len: len, feat: feat, model: model,
|
| 356 |
ctcFstDecoder: ctcFstDecoder
|
|
@@ -796,7 +799,7 @@ function initSherpaOnnxOfflineRecognizerConfig(config, Module) {
|
|
| 796 |
const model = initSherpaOnnxOfflineModelConfig(config.modelConfig, Module);
|
| 797 |
const lm = initSherpaOnnxOfflineLMConfig(config.lmConfig, Module);
|
| 798 |
|
| 799 |
-
const len = feat.len + model.len + lm.len +
|
| 800 |
const ptr = Module._malloc(len);
|
| 801 |
|
| 802 |
let offset = 0;
|
|
@@ -856,6 +859,9 @@ function initSherpaOnnxOfflineRecognizerConfig(config, Module) {
|
|
| 856 |
'i8*');
|
| 857 |
offset += 4;
|
| 858 |
|
|
|
|
|
|
|
|
|
|
| 859 |
return {
|
| 860 |
buffer: buffer, ptr: ptr, len: len, feat: feat, model: model, lm: lm
|
| 861 |
}
|
|
|
|
| 280 |
const ctcFstDecoder = initSherpaOnnxOnlineCtcFstDecoderConfig(
|
| 281 |
config.ctcFstDecoderConfig, Module)
|
| 282 |
|
| 283 |
+
const len = feat.len + model.len + 8 * 4 + ctcFstDecoder.len + 3 * 4;
|
| 284 |
const ptr = Module._malloc(len);
|
| 285 |
|
| 286 |
let offset = 0;
|
|
|
|
| 351 |
buffer + decodingMethodLen + hotwordsFileLen + ruleFstsFileLen, 'i8*');
|
| 352 |
offset += 4;
|
| 353 |
|
| 354 |
+
Module.setValue(ptr + offset, config.blankPenalty || 0, 'float');
|
| 355 |
+
offset += 4;
|
| 356 |
+
|
| 357 |
return {
|
| 358 |
buffer: buffer, ptr: ptr, len: len, feat: feat, model: model,
|
| 359 |
ctcFstDecoder: ctcFstDecoder
|
|
|
|
| 799 |
const model = initSherpaOnnxOfflineModelConfig(config.modelConfig, Module);
|
| 800 |
const lm = initSherpaOnnxOfflineLMConfig(config.lmConfig, Module);
|
| 801 |
|
| 802 |
+
const len = feat.len + model.len + lm.len + 7 * 4;
|
| 803 |
const ptr = Module._malloc(len);
|
| 804 |
|
| 805 |
let offset = 0;
|
|
|
|
| 859 |
'i8*');
|
| 860 |
offset += 4;
|
| 861 |
|
| 862 |
+
Module.setValue(ptr + offset, config.blankPenalty || 0, 'float');
|
| 863 |
+
offset += 4;
|
| 864 |
+
|
| 865 |
return {
|
| 866 |
buffer: buffer, ptr: ptr, len: len, feat: feat, model: model, lm: lm
|
| 867 |
}
|
sherpa-onnx-wasm-main-asr.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|