Commit 8e7862411 for llama.cpp
commit 8e7862411da14d8cc342611f37e15ee05d97bfd3
Author: yoch <yoch.melka@gmail.com>
Date: Fri Nov 20 16:34:58 2026 +0200
tts : forward -t to the mtmd context (#32664)
llama-tts built the mtmd context from mtmd_context_params_default(), which hardcodes 4 threads, and never copied n_threads over, so -t never reach the mtmd side.
Copy params.cpuparams.n_threads into mtmd_params.n_threads, as mtmd-cli and the server do; with no -t this now follows the resolved default.
Verified: -t 1 now runs single-threaded, -t 4 is unchanged, and the produced WAV is identical.
Assisted-by: Claude
diff --git a/tools/tts/tts.cpp b/tools/tts/tts.cpp
index dbf618ac2..238cc828b 100644
--- a/tools/tts/tts.cpp
+++ b/tools/tts/tts.cpp
@@ -86,8 +86,9 @@ int main(int argc, char ** argv) {
}
mtmd_context_params mtmd_params = mtmd_context_params_default();
- mtmd_params.use_gpu = params.mmproj_use_gpu;
- mtmd_params.device = params.mmproj_device;
+ mtmd_params.use_gpu = params.mmproj_use_gpu;
+ mtmd_params.device = params.mmproj_device;
+ mtmd_params.n_threads = params.cpuparams.n_threads;
mtmd::context_ptr mctx(mtmd_init_from_file(params.mmproj.path.c_str(), model, mtmd_params));
if (!mctx) {
LOG_ERR("failed to load mmproj %s\n", params.mmproj.path.c_str());