From: Daniel Bevenius Date: Wed, 8 Apr 2026 12:10:33 +0000 (+0200) Subject: examples : disable cb_eval callback for --save-logits (#21553) X-Git-Tag: upstream/0.0.10438~1728 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=87f4744a805f7837b95ce7ff94fc60eb7a3fbcc8;p=pkg%2Fggml%2Fsources%2Fllama.cpp 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. --- diff --git a/examples/debug/debug.cpp b/examples/debug/debug.cpp index ec80be19b..7ba63b4ff 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);