From 87f4744a805f7837b95ce7ff94fc60eb7a3fbcc8 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 8 Apr 2026 14:10:33 +0200 Subject: [PATCH] examples : disable cb_eval callback for --save-logits (#21553) This commit updates the debug example to not create the base_callback_data. The motivation for this is when using `--save-logits`, which is used by examples/model-conversion scripts, we often don't care about the tensor outputs and they just add noise to the output. This changes is quiet by default we can always remove --save-logits to get the tensor outputs when debugging. --- examples/debug/debug.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/debug/debug.cpp b/examples/debug/debug.cpp index ec80be19ba..7ba63b4ff6 100644 --- a/examples/debug/debug.cpp +++ b/examples/debug/debug.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include static void print_usage(int /*argc*/, char ** argv) { @@ -222,7 +223,10 @@ int main(int argc, char ** argv) { llama_backend_init(); llama_numa_init(params.numa); - base_callback_data cb_data(params, params.tensor_filter); + std::optional cb_data; + if (!params.save_logits) { + cb_data.emplace(params, params.tensor_filter); + } auto llama_init = common_init_from_params(params);