We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52350cc commit d9b38e3Copy full SHA for d9b38e3
llama_cpp/llama.py
@@ -1019,12 +1019,11 @@ def eval(self, tokens: Sequence[int]):
1019
"""
1020
assert self._ctx.ctx is not None
1021
assert self._batch.batch is not None
1022
- n_ctx = self._n_ctx
+ self._ctx.kv_cache_seq_rm(-1, self.n_tokens, -1)
1023
for i in range(0, len(tokens), self.n_batch):
1024
batch = tokens[i : min(len(tokens), i + self.n_batch)]
1025
- n_past = min(n_ctx - len(batch), self.n_tokens)
+ n_past = self.n_tokens
1026
n_tokens = len(batch)
1027
- self._ctx.kv_cache_seq_rm(-1, n_past, -1)
1028
self._batch.set_batch(
1029
batch=batch, n_past=n_past, logits_all=self.context_params.logits_all
1030
)
0 commit comments