From 3653e6d6d547ec763317d9ecd0ace334a7e21359 Mon Sep 17 00:00:00 2001 From: Pascal Date: Fri, 7 Aug 2026 22:35:52 +0200 Subject: [PATCH] tts: account for the vocoder pass in the timings line (#26733) get_output runs the waveform work the pipeline defers to it, from a single trailing window to a full pass depending on the model. Measuring it keeps the reported total and the audio to process ratio honest. --- tools/tts/tts.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/tts/tts.cpp b/tools/tts/tts.cpp index b68edcaf57..49c405e147 100644 --- a/tools/tts/tts.cpp +++ b/tools/tts/tts.cpp @@ -179,17 +179,20 @@ int main(int argc, char ** argv) { const char * data = nullptr; size_t data_len = 0; int64_t n_samples = 0; + const int64_t t_wav_start_us = ggml_time_us(); if (gen.get_output(&sample_rate, &data, &data_len, &n_samples) != 0) { LOG_ERR("get_output failed\n"); return 1; } + const double t_wav_s = (ggml_time_us() - t_wav_start_us) / 1e6; LOG_INF("generated %d frames, %zu bytes of WAV audio (%d Hz)\n", n_frames, data_len, sample_rate); const double t_prompt_s = (t_gen_start_us - t_prompt_start_us) / 1e6; - const double t_total_s = t_prompt_s + t_gen_s; + const double t_total_s = t_prompt_s + t_gen_s + t_wav_s; const double audio_s = sample_rate > 0 ? (double) n_samples / sample_rate : 0.0; - LOG_INF("timings: prompt eval %.2fs + generation %.2fs = total %.2fs\n", t_prompt_s, t_gen_s, t_total_s); + LOG_INF("timings: prompt eval %.2fs + generation %.2fs + vocoder %.2fs = total %.2fs\n", + t_prompt_s, t_gen_s, t_wav_s, t_total_s); LOG_INF(" output audio = %.2fs (audio time = %.2fx process time)\n", audio_s, t_total_s > 0 ? audio_s / t_total_s : 0.0); FILE * f = fopen(params.out_file.c_str(), "wb"); if (!f) {