Skip to content

Commit cda88c3

Browse files
authored
examples : disable cb_eval callback for --save-logits (ggml-org#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.
1 parent 1af5f0a commit cda88c3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

examples/debug/debug.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <vector>
1010
#include <filesystem>
1111
#include <fstream>
12+
#include <optional>
1213
#include <regex>
1314

1415
static void print_usage(int /*argc*/, char ** argv) {
@@ -222,7 +223,10 @@ int main(int argc, char ** argv) {
222223
llama_backend_init();
223224
llama_numa_init(params.numa);
224225

225-
base_callback_data cb_data(params, params.tensor_filter);
226+
std::optional<base_callback_data> cb_data;
227+
if (!params.save_logits) {
228+
cb_data.emplace(params, params.tensor_filter);
229+
}
226230

227231
auto llama_init = common_init_from_params(params);
228232

0 commit comments

Comments
 (0)