-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- I carefully followed the README.md.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- I reviewed the Discussions, and have a new bug or useful enhancement to share.
Feature Description
Using ordered JSONs in json-schema-to-grammar so that the llama.cpp follows the order of the JSON schema.
Motivation
I've been trying the new C++ json-schema-to-grammar from #5978 and I've noticed that there is no prop_order, which is present in the python version, to order the keys of the JSON schema. I think this could be interesting since generating text for some specific keys can improve the text generation of the following keys.
Possible Implementation
An easy solution is replacing the base json nlohmann::json
with nlohmann::ordered_json
in both files json-schema-to-grammar.h and json-schema-to-grammar.cpp. This will result in JSON that preserves the original order of the keys.
ochafik
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request