Skip to content
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

Direct BNF support #634

Open
Bainainai opened this issue Nov 22, 2024 · 1 comment
Open

Direct BNF support #634

Bainainai opened this issue Nov 22, 2024 · 1 comment

Comments

@Bainainai
Copy link

I was able to find support for JSON schemas in the project, and it seems to actually get implemented under the hood by BNF. I was wondering if WebLLM could directly support BNF instead of reaching it in a roundabout way by first giving it a JSON schema. I tried to investigate to see if I could make it happen myself, but I got lost when I found references to mlc.grammar.BNFGrammarGetGrammarOfJSON and mlc.grammar.BNFGrammarFromSchema and couldn't figure out where those were defined. It seemed to me that they are supposed to come from the @mlc-ai/web-runtime package, but the TVM project that is referenced as its source code does not seem to have these functions in it.

@CharlieFRuan
Copy link
Contributor

CharlieFRuan commented Nov 22, 2024

Just supported via ^0.2.76 after integrating with XGrammar: #635

Check out examples/json-schema's ebnfGrammarExample() for a full example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants