From f74e266f0467054c035e1b9597bdb526f2a9a1d6 Mon Sep 17 00:00:00 2001 From: younesbelkada Date: Mon, 7 Jul 2025 17:23:47 +0400 Subject: [PATCH] fix comment --- src/llama-context.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/llama-context.cpp b/src/llama-context.cpp index 0eabc76ddf..06e93b19cb 100644 --- a/src/llama-context.cpp +++ b/src/llama-context.cpp @@ -2220,8 +2220,14 @@ llama_context * llama_init_from_model( return nullptr; } - auto * ctx = new llama_context(*model, params); - return ctx; + try { + auto * ctx = new llama_context(*model, params); + return ctx; + } catch (const std::exception & err) { + LLAMA_LOG_ERROR("%s: failed to initialize the context: %s\n", __func__, err.what()); + } + + return nullptr; } // deprecated