diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-26 07:31:21 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-26 07:31:21 +0200 |
| commit | 80982b5953c221ab25b4cd3f0cd1cd935261774f (patch) | |
| tree | f372710d74232185b020b5713685227e6add67f0 /assistant.py | |
| parent | da1083948c935d8e0e57e49101bd920725d65acd (diff) | |
| download | desktop-assistant-80982b5953c221ab25b4cd3f0cd1cd935261774f.tar.gz desktop-assistant-80982b5953c221ab25b4cd3f0cd1cd935261774f.zip | |
Use the system kokoro-onnx package, drop the venv
kokoro-onnx is now packaged (python3-kokoro-onnx, without
espeakng-loader) and finds the system espeak-ng with its default
config, so the explicit EspeakConfig and the .venv setup go away.
Tested live: two Italian questions answered and spoken correctly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'assistant.py')
| -rw-r--r-- | assistant.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/assistant.py b/assistant.py index 49fb082..00c1081 100644 --- a/assistant.py +++ b/assistant.py @@ -17,7 +17,7 @@ """Mic button on: record. Mic button off: transcribe (whisper-server), ask the loaded llama-server model, speak the reply (Kokoro). -Run: .venv/bin/python assistant.py (--test runs the self-check) +Run: python3 assistant.py (--test runs the self-check) """ import ctypes @@ -134,12 +134,8 @@ def ask(messages): def speaker(q): - from kokoro_onnx import Kokoro, EspeakConfig - # The espeakng-loader wheel's bundled lib has a broken data path; use - # the system espeak-ng. - k = Kokoro(f"{MODELS}/kokoro/kokoro-v1.0.onnx", f"{MODELS}/kokoro/voices-v1.0.bin", - espeak_config=EspeakConfig(lib_path="/usr/lib64/libespeak-ng.so.1", - data_path="/usr/share/espeak-ng-data")) + from kokoro_onnx import Kokoro + k = Kokoro(f"{MODELS}/kokoro/kokoro-v1.0.onnx", f"{MODELS}/kokoro/voices-v1.0.bin") voices = {"it": 0.8 * k.get_voice_style("if_sara") + 0.2 * k.get_voice_style("af_bella"), "en": k.get_voice_style("af_heart")} play = None |
