From da6c28eb1372e734486caf51bc424404dc981493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sun, 27 Sep 2026 12:05:50 +0200 Subject: [PATCH] common : throw instead of abort on grammar without llguidance (#29516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- common/sampling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/sampling.cpp b/common/sampling.cpp index 06dea1e1cc..27a752cc8d 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -214,7 +214,7 @@ struct common_sampler * common_sampler_init( #ifdef LLAMA_USE_LLGUIDANCE grmr = llama_sampler_init_llg(vocab, "lark", grammar_str.c_str()); #else - GGML_ABORT("llguidance (cmake -DLLAMA_LLGUIDANCE=ON) is not enabled"); + throw std::runtime_error("failed to parse grammar: llguidance is not enabled"); #endif // LLAMA_USE_LLGUIDANCE } else { std::vector trigger_patterns;