mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-09 16:44:35 +00:00
Add memoized cache to llama_grammar_reject_candidates_for_stack
(#1615)
* Add memoized cache to llama_grammar_reject_candidates_for_stack * make size cutoff more aggressive and move to outer branch * update comment * add cache reset whenever grammar is reloaded * remove explicit reference types for compiler transportability
This commit is contained in:
parent
b884a7f058
commit
54dde5e565
2 changed files with 60 additions and 0 deletions
|
@ -1773,6 +1773,7 @@ static void load_grammar(const std::string & gammarstr)
|
|||
{
|
||||
if(grammar!=nullptr) //on demand free when next grammar is loaded
|
||||
{
|
||||
llama_grammar_reset_memos();
|
||||
llama_grammar_free_impl(grammar);
|
||||
grammar = nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue