From 83cdf3396d0f87236311fd8233760a694cdef932 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 5 Apr 2026 22:53:59 -0700 Subject: [PATCH] fix: use full onnx model with 8 threads for fast local TTS Benchmark: short=0.37s, long=1.06s with 8 CPU threads. GPU not available in pip sherpa-onnx, CPU is fast enough. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/main/xiaozhi-server/core/providers/tts/sherpa_tts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/main/xiaozhi-server/core/providers/tts/sherpa_tts.py b/backend/main/xiaozhi-server/core/providers/tts/sherpa_tts.py index ada9fda..04b2e5c 100644 --- a/backend/main/xiaozhi-server/core/providers/tts/sherpa_tts.py +++ b/backend/main/xiaozhi-server/core/providers/tts/sherpa_tts.py @@ -23,7 +23,7 @@ class TTSProvider(TTSProviderBase): if not os.path.exists(model_file): model_file = f"{model_dir}/model.onnx" - num_threads = int(config.get("num_threads", 4)) + num_threads = int(config.get("num_threads", 8)) tts_config = sherpa_onnx.OfflineTtsConfig( model=sherpa_onnx.OfflineTtsModelConfig(