Skip to content

Commit 35cad4f

Browse files
committed
make lint
Signed-off-by: Sungjae Lee <33976427+llsj14@users.noreply.github.com>
1 parent 366cc0c commit 35cad4f

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

vllm/v1/sample/logits_processor.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,20 @@ def is_argmax_invariant(self) -> bool:
518518
def update_state(self, batch_update: Optional[BatchUpdate]):
519519
if batch_update:
520520
for index, params, prompt_tok_ids, output_tok_ids in batch_update.added:
521-
max_think_tokens = params.max_think_tokens if isinstance(params, SamplingParams) else None
521+
max_think_tokens = (
522+
params.max_think_tokens
523+
if isinstance(params, SamplingParams)
524+
else None
525+
)
522526
if max_think_tokens is not None:
523-
last_start = self._find_last_token_index(prompt_tok_ids, self.think_start_token_id)
524-
last_end = self._find_last_token_index(prompt_tok_ids, self.think_end_token_id)
527+
last_start = self._find_last_token_index(
528+
prompt_tok_ids,
529+
self.think_start_token_id
530+
)
531+
last_end = self._find_last_token_index(
532+
prompt_tok_ids,
533+
self.think_end_token_id
534+
)
525535
in_think = last_start > last_end
526536
count = len(prompt_tok_ids) - (last_start + 1) if in_think else 0
527537

@@ -534,13 +544,13 @@ def update_state(self, batch_update: Optional[BatchUpdate]):
534544
}
535545

536546
for index in batch_update.removed:
537-
self._state.pop(index, None)
547+
self._state.pop(index, {})
538548

539549
for i1, i2, direction in batch_update.moved:
540550
if direction == MoveDirectionality.SWAP:
541551
self._state[i1], self._state[i2] = self._state[i2], self._state[i1]
542552
else:
543-
self._state[i2] = self._state.pop(i1, None)
553+
self._state[i2] = self._state.pop(i1, {})
544554

545555
# Update in_think and count for all active requests
546556
for state in self._state.values():

0 commit comments

Comments
 (0)