]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server: use pos_next instead of n_tokens for m-rope (#22439)
authorAman Gupta <redacted>
Tue, 28 Apr 2026 05:41:00 +0000 (13:41 +0800)
committerGitHub <redacted>
Tue, 28 Apr 2026 05:41:00 +0000 (08:41 +0300)
tools/server/server-context.cpp

index 08ff1e3628a5416a3b09d5034c0500674d3d8807..567ddd4f9992f29cdd42ee42a4bd62266cc18e3c 100644 (file)
@@ -3031,7 +3031,7 @@ private:
                 slot.sampled = ids.back(); // last accepted token
                 SLT_DBG(slot, "add accepted tokens: sampled=%d, ids.size=%zu, n_draft=%zu\n", slot.sampled, ids.size(), n_draft);
 
-                llama_memory_seq_rm(llama_get_memory(slot.ctx), slot.id, slot.prompt.n_tokens(), -1);
+                llama_memory_seq_rm(llama_get_memory(slot.ctx), slot.id, slot.prompt.tokens.pos_next(), -1);
 
                 for (size_t i = 0; i < ids.size(); ++i) {
                     completion_token_output result;