mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-07 16:37:57 +02:00
common/json-schema : fix GBNF grammar generation for empty object schemas (#28279)
This commit is contained in:
@@ -734,6 +734,9 @@ class SchemaConverter:
|
||||
)
|
||||
optional_props.append("*")
|
||||
|
||||
if not required_props and not optional_props:
|
||||
return '"{" space "}"'
|
||||
|
||||
rule = '"{" space '
|
||||
rule += ' "," space '.join(prop_kv_rule_names[k] for k in required_props)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user