From 1189f6000c8177a81709002b903656316a47a867 Mon Sep 17 00:00:00 2001 From: boksbc Date: Mon, 11 May 2026 22:20:20 +0200 Subject: [PATCH] fix: use onnxruntime for Apple Silicon, venv python path, ignore .venv Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 1 + electron/wakeword.js | 3 ++- python/wakeword.py | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2fb9370..2ca38e3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist/ .env .idea/ .DS_Store +python/.venv/ diff --git a/electron/wakeword.js b/electron/wakeword.js index 731df3d..6436f87 100644 --- a/electron/wakeword.js +++ b/electron/wakeword.js @@ -13,8 +13,9 @@ function startWakeword({ onWake }, retries = 0) { running = true; const scriptPath = path.join(__dirname, '../python/wakeword.py'); + const pythonPath = path.join(__dirname, '../python/.venv/bin/python3'); - const proc = spawn('python3', [scriptPath], { + const proc = spawn(pythonPath, [scriptPath], { stdio: ['pipe', 'pipe', 'pipe'], }); wakewordProcess = proc; diff --git a/python/wakeword.py b/python/wakeword.py index b23c10d..6e1f2ef 100644 --- a/python/wakeword.py +++ b/python/wakeword.py @@ -9,7 +9,12 @@ RATE = 16000 THRESHOLD = 0.5 def main(): - model = Model(wakeword_models=["hey_jarvis"]) + import openwakeword + openwakeword.utils.download_models(["hey_jarvis"]) + model = Model( + wakeword_models=["hey_jarvis"], + inference_framework="onnx" + ) pa = pyaudio.PyAudio() stream = pa.open(