10000 Fix: json_schema_to_gbnf should take string dump of json schema as input · tk-master/llama-cpp-python@faeae18 · GitHub
[go: up one dir, main page]

Skip to content

Commit faeae18

Browse files
committed
Fix: json_schema_to_gbnf should take string dump of json schema as input
1 parent e7962d2 commit faeae18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama_cpp/llama_grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ def format_grammar(self):
14841484

14851485
def json_schema_to_gbnf(schema: str, prop_order: Optional[List[str]] = None):
14861486
prop_order = prop_order or []
1487-
schema = json.load(schema)
1487+
schema = json.loads(schema)
14881488
prop_order = {name: idx for idx, name in enumerate(prop_order)}
14891489
converter = SchemaConverter(prop_order)
14901490
converter.visit(schema, "")

0 commit comments

Comments
 (0)
0