From 042f595632915f379da5989a0e1420081fbb7399 Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Fri, 26 Sep 2025 08:46:42 +0300 Subject: [PATCH] Add mtmd: use LOG_TEE so generated tokens show up in terminal --- examples/mtmd/mtmd-cli.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mtmd/mtmd-cli.cpp b/examples/mtmd/mtmd-cli.cpp index 8ff8d7ab..fa5d7ac8 100644 --- a/examples/mtmd/mtmd-cli.cpp +++ b/examples/mtmd/mtmd-cli.cpp @@ -218,7 +218,7 @@ static int generate_response(mtmd_cli_context & ctx, int n_predict) { llama_tokens generated_tokens; for (int i = 0; i < n_predict; i++) { if (i > n_predict || !g_is_generating || g_is_interrupted) { - LOG("\n"); + LOG_TEE("\n"); break; } @@ -227,15 +227,15 @@ static int generate_response(mtmd_cli_context & ctx, int n_predict) { common_sampler_accept(ctx.smpl, ctx.lctx, token_id, true); if (llama_vocab_is_eog(ctx.vocab, token_id) || ctx.check_antiprompt(generated_tokens)) { - LOG("\n"); + LOG_TEE("\n"); break; // end of generation } - LOG("%s", common_token_to_piece(ctx.lctx, token_id).c_str()); + LOG_TEE("%s", common_token_to_piece(ctx.lctx, token_id).c_str()); fflush(stdout); if (g_is_interrupted) { - LOG("\n"); + LOG_TEE("\n"); break; }