common : throw instead of abort on grammar without llguidance (#29516)

Signed-off-by: Adrien Gallouët <[email protected]>
This commit is contained in:
Adrien Gallouët
2026-09-27 13:05:50 +03:00
committed by GitHub
parent d7fb90e8e2
commit da6c28eb13
+1 -1
View File
@@ -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<std::string> trigger_patterns;