From 8c8779cd059d64827f148c9532645c641512a04d Mon Sep 17 00:00:00 2001 From: yukavio <67678385+yukavio@users.noreply.github.com> Date: Fri, 3 Jan 2025 02:28:39 +0800 Subject: [PATCH] [Fix] fix retract error in eagle speculative decoding (#2711) Co-authored-by: kavioyu --- python/sglang/srt/speculative/eagle_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/speculative/eagle_utils.py b/python/sglang/srt/speculative/eagle_utils.py index 9d1a73aba..f76cca2d5 100644 --- a/python/sglang/srt/speculative/eagle_utils.py +++ b/python/sglang/srt/speculative/eagle_utils.py @@ -601,11 +601,11 @@ class EagleVerifyInput(SpecInfo): req.check_finished() if req.finished(): draft_input.has_finished = True - finished_extend_len[req.rid] = verified_len + 1 else: new_accept_index.append(accept_index[low : low + verified_len + 1]) unfinished_index.append(i) low += verified_len + 1 + finished_extend_len[req.rid] = verified_len + 1 if len(new_accept_index) > 0: new_accept_index = torch.cat(new_accept_index, dim=0)