Skip to content

Commit

Permalink
fix(silero): Windows compat: correct file load (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp authored Nov 22, 2024
1 parent 4a77de8 commit 15da911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mighty-dogs-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/agents-plugin-silero": patch
---

Windows compat: correct file load
3 changes: 2 additions & 1 deletion plugins/silero/src/onnx_model.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { fileURLToPath } from 'node:url';
import { InferenceSession, Tensor } from 'onnxruntime-node';

export type SampleRate = 8000 | 16000;

export const newInferenceSession = (forceCPU: boolean) => {
return InferenceSession.create(new URL('silero_vad.onnx', import.meta.url).pathname, {
return InferenceSession.create(fileURLToPath(new URL('silero_vad.onnx', import.meta.url).href), {
interOpNumThreads: 1,
intraOpNumThreads: 1,
executionMode: 'sequential',
Expand Down

0 comments on commit 15da911

Please sign in to comment.