]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : fix ambiguous grammar rule in gemma4 (#21661)
authorAldehir Rojas <redacted>
Thu, 9 Apr 2026 10:25:07 +0000 (05:25 -0500)
committerGitHub <redacted>
Thu, 9 Apr 2026 10:25:07 +0000 (12:25 +0200)
* common : fix ambiguous grammar rule in gemma4

* cont : fix missing comma...

common/chat.cpp

index 1de8a3ba8f8d83c48193efcfef09072de9fb834c..f79fe703db06e5dedbde0476b74e9461e41a6d90 100644 (file)
@@ -1124,7 +1124,7 @@ static common_chat_params common_chat_params_init_gemma4(const common_chat_templ
             p.rule("gemma4-bool", p.json_bool());
             p.rule("gemma4-null", p.json_null());
             p.rule("gemma4-number", p.json_number());
-            p.rule("gemma4-dict-key", p.rule("gemma4-dict-key-name", p.until(":")) + p.literal(":"));
+            p.rule("gemma4-dict-key", p.rule("gemma4-dict-key-name", p.chars("[^:}]", 1, -1)) + p.literal(":"));
             p.rule("gemma4-dict-kv", p.ref("gemma4-dict-key") + p.space() + p.ref("gemma4-value"));
             p.rule("gemma4-dict", [&]() {
                 auto ws = p.space();