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

Add C language binding for grammar-parser to core. #2838

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philipag
Copy link

@philipag philipag commented Feb 24, 2025

The main idea is to create a C facade for grammar loading so that it can easily be used to load/allocate (and later free) grammars via any type of language binding.

This facade is extracted from a different project and not yet part of the whisper.cpp build.

This addresses #1930

@philipag
Copy link
Author

philipag commented Feb 24, 2025

I now realize that this really belongs in ggml so someone familiar with ggml build files could repurpose this code to there...

However, this also needs to be exposed via whisper.cpp so that whisper clients which don't directly deal with ggml can parse grammars (e.g. I am using whisper.net).

Finally, some language bindings will additionally need a free() method.

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

Successfully merging this pull request may close these issues.

1 participant