Fixed segfault during context swap introduced by commit 3d6ed185
This commit is contained in:
parent
5ec0d12652
commit
c3e9c88d71
1 changed files with 2 additions and 0 deletions
|
@ -359,6 +359,8 @@ int main(int argc, char ** argv) {
|
|||
if (n_past + (int) embd.size() > n_ctx) {
|
||||
const int n_left = n_past - params.n_keep;
|
||||
|
||||
n_past = params.n_keep;
|
||||
|
||||
// insert n_left/2 tokens at the start of embd from last_n_tokens
|
||||
embd.insert(embd.begin(), last_n_tokens.begin() + n_ctx - n_left/2 - embd.size(), last_n_tokens.end() - embd.size());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue