mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user