Confine max-prefix-len to where it is used and drop the leftover variable (#25719)

This commit is contained in:
fzyzcjy
2026-05-19 09:20:21 +08:00
committed by GitHub
parent 1cba3ab467
commit 32f1259c91
+1 -1
View File
@@ -1022,11 +1022,11 @@ class Req(ReqDllmMixin):
max_prefix_len = min(max_prefix_len, self.logprob_start_len)
max_prefix_len = max(max_prefix_len, 0)
token_ids = self.fill_ids[:max_prefix_len]
del max_prefix_len
# Disable prefix caching when embed overrides are present: same token IDs
# with different override vectors must not share cached KV values.
if self.positional_embed_overrides is not None:
max_prefix_len = 0
token_ids = []
if tree_cache is not None: