-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Check the full vocab for grammar only if necessary #4306
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
Changes from 3 commits
2e3b4f6
281e2ba
de454b9
245de1f
f5f9d96
115a921
b4377ee
88fd22c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,10 +98,11 @@ std::string llama_sampling_print(const llama_sampling_params & params); | |
| // - candidates: vector of candidate tokens | ||
| // | ||
| llama_token llama_sampling_sample( | ||
| struct llama_sampling_context * ctx_sampling, | ||
| struct llama_context * ctx_main, | ||
| struct llama_context * ctx_cfg, | ||
| int idx = 0); | ||
| struct llama_sampling_context * ctx_sampling, | ||
| struct llama_context * ctx_main, | ||
| struct llama_context * ctx_cfg, | ||
| const int idx, | ||
| bool is_resampling = false); // Add the new parameter with default value | ||
|
||
|
|
||
| void llama_sampling_accept( | ||
| struct llama_sampling_context * ctx_sampling, | ||
|
|
||
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.
Yeah we could probably expose something more straightforward to check this if we want. It would probably be like
llama_grammar_accept_tokenbut returning a bool instead of throwing.