[Reasoning] Optimize TPOT for thinking budget when used with speculative decoding (#46662)

Signed-off-by: rishitdholakia13 <rishit+github@cohere.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
rishitdholakia13
2026-07-14 18:55:40 +00:00
committed by GitHub
co-authored by Cursor
parent 7ffb98e248
commit 32e632dfeb
3 changed files with 7 additions and 20 deletions
-6
View File
@@ -145,12 +145,6 @@ class ThinkingBudgetStateHolder:
state["spec_token_ids"] = []
state["in_spec_mode"] = self.in_spec_mode
state["force_index"] = []
if len(state["output_tok_ids"]) > 0:
spec_len = len(state["spec_token_ids"])
# Only strip draft suffix when there are spec tokens; ``[:-0]`` would
# clear the whole list (Python treats stop index 0 as "up to empty").
if spec_len > 0 and len(state["output_tok_ids"]) >= spec_len:
state["output_tok_ids"] = state["output_tok_ids"][:-spec_len]
self._update_think_state(state)
def apply_to_logits(