@fonoster/autopilot 0.9.38 → 0.9.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,7 +36,11 @@ class SileroVadModel {
|
|
|
36
36
|
}
|
|
37
37
|
async init() {
|
|
38
38
|
const modelArrayBuffer = (0, fs_1.readFileSync)(this.pathToModel).buffer;
|
|
39
|
-
const sessionOption = {
|
|
39
|
+
const sessionOption = {
|
|
40
|
+
interOpNumThreads: 1,
|
|
41
|
+
intraOpNumThreads: 1,
|
|
42
|
+
enableCpuMemArena: false
|
|
43
|
+
};
|
|
40
44
|
this._session = await this.ort.InferenceSession.create(modelArrayBuffer, sessionOption);
|
|
41
45
|
// Validate model inputs/outputs
|
|
42
46
|
const requiredInputs = ["input", "state", "sr"];
|
package/dist/vadv5/createVad.js
CHANGED
|
@@ -63,7 +63,13 @@ const BUFFER_SIZE = 512; // 32ms @ 16kHz
|
|
|
63
63
|
async function createVad(params) {
|
|
64
64
|
const { pathToModel, activationThreshold, deactivationThreshold, debounceFrames } = params;
|
|
65
65
|
const effectivePath = pathToModel || (0, path_1.join)(__dirname, "..", "..", "silero_vad_v5.onnx");
|
|
66
|
-
const
|
|
66
|
+
const ortAdapter = {
|
|
67
|
+
InferenceSession: {
|
|
68
|
+
create: ort.InferenceSession.create.bind(ort.InferenceSession)
|
|
69
|
+
},
|
|
70
|
+
Tensor: ort.Tensor
|
|
71
|
+
};
|
|
72
|
+
const silero = await SileroVadModel_1.SileroVadModel.new(ortAdapter, effectivePath);
|
|
67
73
|
let sampleBuffer = [];
|
|
68
74
|
let isSpeechActive = false;
|
|
69
75
|
let framesSinceStateChange = 0;
|
package/dist/vadv5/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface ONNXRuntimeAPI {
|
|
|
29
29
|
create: (modelPath: ArrayBuffer | string, options?: {
|
|
30
30
|
interOpNumThreads: number;
|
|
31
31
|
intraOpNumThreads: number;
|
|
32
|
+
enableCpuMemArena: boolean;
|
|
32
33
|
}) => Promise<ONNXSession>;
|
|
33
34
|
};
|
|
34
35
|
Tensor: new (type: string, data: Float32Array | bigint[], dims: number[]) => ONNXTensor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/autopilot",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.39",
|
|
4
4
|
"description": "Voice AI for the Fonoster platform",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"js-yaml": "^4.1.0",
|
|
51
51
|
"langchain": "^0.3.6",
|
|
52
52
|
"moment": "^2.30.1",
|
|
53
|
-
"onnxruntime-node": "^1.
|
|
53
|
+
"onnxruntime-node": "^1.21.0",
|
|
54
54
|
"pdf-parse": "^1.1.1",
|
|
55
55
|
"uuid": "^11.0.3",
|
|
56
56
|
"xstate": "^5.17.3",
|
|
57
57
|
"zod": "^3.23.8"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "ff9bc63efb101ceb4c6c4e08b7b11f720336454c"
|
|
60
60
|
}
|