mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-22 03:10:03 +00:00
context shift even more lenient
This commit is contained in:
parent
edb3dc362a
commit
066e73d769
1 changed files with 3 additions and 3 deletions
|
|
@ -620,8 +620,8 @@ void PurgeMissingTokens(llama_context * ctx, std::vector<int> ¤t_context_t
|
|||
//if passed, save beginning of LCQ from old ctx as p1
|
||||
//remove all tokens from old ctx between p0 and p1, updating both arrays and kv, then continue as normal
|
||||
|
||||
const int ShortfallThreshold = 200 + (nctx/20); //dont trigger shifting if the distance between trimstart and currhead < this
|
||||
const int SlackAllowance = 50 + (nctx/50); //in case the end text is slightly modified, be forgiving
|
||||
const int ShortfallThreshold = 200 + (nctx/30); //dont trigger shifting if the distance between trimstart and currhead < this
|
||||
const int SlackAllowance = 60 + (nctx/50); //in case the end text is slightly modified, be forgiving
|
||||
|
||||
int trimstart = 0;
|
||||
int new_tokens_len = new_context_tokens.size();
|
||||
|
|
@ -650,7 +650,7 @@ void PurgeMissingTokens(llama_context * ctx, std::vector<int> ¤t_context_t
|
|||
}
|
||||
|
||||
//at least this many tokens need to match, otherwise don't bother trimming
|
||||
const int LCSTokThreshold = std::max(std::min((new_tokens_len - trimstart) - (genamt+SlackAllowance), (int)(nctx*0.5)), ShortfallThreshold-SlackAllowance);
|
||||
const int LCSTokThreshold = std::max(std::min((new_tokens_len - trimstart) - (genamt+SlackAllowance), (int)(nctx*0.45)), ShortfallThreshold-SlackAllowance);
|
||||
|
||||
auto curr_ctx_without_memory = std::vector<int>(current_context_tokens.begin() + trimstart, current_context_tokens.end());
|
||||
auto new_ctx_without_memory = std::vector<int>(new_context_tokens.begin() + trimstart, new_context_tokens.end());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue