Skip to content

LLM inference in C/C++

C++ ggml

llama-bench : fix verbosity filter to show GGML_LOG_ERROR (#28229)

Kushal Garg7dad6db85869
diff --git a/tools/llama-bench/llama-bench.cpp b/tools/llama-bench/llama-bench.cpp
index fd64b4c442..8361e6ae6c 100644
--- a/tools/llama-bench/llama-bench.cpp
+++ b/tools/llama-bench/llama-bench.cpp
@@ -2222,8 +2222,10 @@ static bool test_gen(llama_context * ctx, int n_gen, int n_threads) {
}
static void llama_null_log_callback(enum ggml_log_level level, const char * text, void * user_data) {
- (void) level;
- (void) text;
+ if (level == GGML_LOG_LEVEL_ERROR) {
+ fprintf(stderr, "%s", text);
+ return;
+ }
(void) user_data;
}