mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-10 18:51:45 +00:00
Correction to 4a37251a
- since we did not insert the bos token, do not need attempt to rescue it during context swap
This commit is contained in:
parent
4a37251a18
commit
3d6ed18542
@ -359,9 +359,6 @@ int main(int argc, char ** argv) {
|
|||||||
if (n_past + (int) embd.size() > n_ctx) {
|
if (n_past + (int) embd.size() > n_ctx) {
|
||||||
const int n_left = n_past - params.n_keep;
|
const int n_left = n_past - params.n_keep;
|
||||||
|
|
||||||
// always keep the first token - BOS
|
|
||||||
n_past = std::max(1, params.n_keep);
|
|
||||||
|
|
||||||
// insert n_left/2 tokens at the start of embd from last_n_tokens
|
// 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());
|
embd.insert(embd.begin(), last_n_tokens.begin() + n_ctx - n_left/2 - embd.size(), last_n_tokens.end() - embd.size());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user