-
Notifications
You must be signed in to change notification settings - Fork 13.5k
support for llguidance grammars #10224
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
Merged
Merged
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
76290d9
initial porting of previous LLG patch
mmoskal f19655c
update for new APIs
mmoskal f4dc4b8
build: integrate llguidance as an external project
mmoskal afb6cac
use '%llguidance' as marker to enable llg lark syntax
mmoskal b5399d4
add some docs
mmoskal adc4aed
clarify docs
mmoskal 2a92bfb
code style fixes
mmoskal 8cb12d4
remove llguidance.h from .gitignore
mmoskal de269a1
fix tests when llg is enabled
mmoskal a7be666
pass vocab not model to llama_sampler_init_llg()
mmoskal 3675050
copy test-grammar-integration.cpp to test-llguidance.cpp
mmoskal 58006dd
clang fmt
mmoskal 036b91f
fix ref-count bug
mmoskal f245ca2
build and run test
mmoskal 16a5484
gbnf -> lark syntax
mmoskal 2937537
conditionally include llguidance test based on LLAMA_LLGUIDANCE flag
mmoskal c7ebf57
rename llguidance test file to test-grammar-llguidance.cpp
mmoskal 0a211fc
add gh action for llg test
mmoskal 8e027f8
align tests with LLG grammar syntax and JSON Schema spec
mmoskal ca88ce7
llama_tokenizer() in fact requires valid utf8
mmoskal 44e1973
update llg
mmoskal c9e9853
format file
mmoskal efc36c9
add $LLGUIDANCE_LOG_LEVEL support
mmoskal 08fefd1
fix whitespace
mmoskal 1afc53a
fix warning
mmoskal 00fcd98
include <cmath> for INFINITY
mmoskal 437ff31
add final newline
mmoskal 5475357
fail llama_sampler_init_llg() at runtime
mmoskal d06448a
Link gbnf_to_lark.py script; fix links; refer to llg docs for lexemes
mmoskal 59da969
simplify #includes
mmoskal d59d939
improve doc string for LLAMA_LLGUIDANCE
mmoskal 6b2de55
Merge branch 'master' into llg
mmoskal a049afb
typo in merge
mmoskal 7057589
bump llguidance to 0.6.12
mmoskal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,273 @@ | ||||||||||||||||||||
| #include "common.h" | ||||||||||||||||||||
| #include "sampling.h" | ||||||||||||||||||||
| #include "log.h" | ||||||||||||||||||||
| #include "llama.h" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| #include <cmath> | ||||||||||||||||||||
|
||||||||||||||||||||
| #include "common.h" | |
| #include "sampling.h" | |
| #include "log.h" | |
| #include "llama.h" | |
| #include <cmath> | |
| #include "sampling.h" | |
| #include "log.h" | |
| #include "llama.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<cmath> is actually required on Linux for INFINITY constant; I did remove common.h though, thank you!
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should somehow be indicated that it is used by the
commonlibrary. I am not sure what would be the best way. Maybe rename it toLLAMA_COMMON_LLGUIDANCE? But even if we leave it like this, it's ok - just making a note.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-worded the help string, maybe that is enough for now?