-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feature: constrained grammars #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related existing solution https://github.com/microsoft/guidance/ |
See also: https://github.com/1rgs/jsonformer I think there are probably two ways to accomplish this:
Both approaches have pros and cons, and both require significant effort in parsing syntax. JSONFormer appears to be the latter, better approach, but also refers to other implementations that seem to do the former. |
I can share some updates very soon - I got it working with the llama.cpp PR which adds constrained grammars ( I don't have the link now). I could successfully implement OpenAI functions. Will follow up shortly with my experiments |
When |
Is your feature request related to a problem? Please describe.
Output of valid JSON, YAML, or alikes from a model is challenging. Models hallucinates, prompts needs to be fine-tuned, and there is no guarantee it spits valid output format.
Describe the solution you'd like
A way to constrain the output with a grammar. Ideally, would be great to have here as an endpoint this https://twitter.com/GrantSlatton/status/1660348210605596672 - grantslatton/llama.cpp@007e26a .
Describe alternatives you've considered
N/A
Additional context
The text was updated successfully, but these errors were encountered: