From: marcoStocchi Date: Mon, 31 Mar 2025 08:20:30 +0000 (+0200) Subject: tts : remove printfs (#12640) X-Git-Tag: upstream/0.0.5028~25 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=52de2e594979be52f0da92601747aa44a13e50e4;p=pkg%2Fggml%2Fsources%2Fllama.cpp tts : remove printfs (#12640) * tts.cpp : llama tokens console output is done using LOG_INF instead of printf(). Therefore the options '--log-disable' and '--log-file' have now uniform impact on all output. --- diff --git a/examples/tts/tts.cpp b/examples/tts/tts.cpp index 4cc42e16..c7ac94cc 100644 --- a/examples/tts/tts.cpp +++ b/examples/tts/tts.cpp @@ -699,11 +699,13 @@ lovely<|t_0.56|><|code_start|><|634|><|596|><|1766|><|1556|><|1306|><|1285|><|14 const std::string voice_data = audio_data; auto tmp = common_tokenize(vocab, voice_data, false, true); - printf("\n\n"); + + std::ostringstream tokens_oss; for (size_t i = 0; i < tmp.size(); ++i) { - printf("%d, ", tmp[i]); + tokens_oss << tmp[i] << ", "; } - printf("\n\n"); + LOG_INF("\n\n%s: llama tokens: %s\n\n", __func__, tokens_oss.str().c_str()); + prompt_add(prompt_inp, tmp); #else prompt_add(prompt_inp, llama_tokens {