From 983b2752f1c92bf8d623d996e0de54167c018574 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 7 Apr 2026 12:19:59 +0200 Subject: [PATCH] examples : disable cb_eval callback for --save-logits 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 ec80be19ba4..7ba63b4ff60 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);