Skip to content

Commit 9ad28f6

Browse files
authored
fix(srt): check if sample_indices is not None before usage. (#5633)
1 parent d7b1ce6 commit 9ad28f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/sglang/srt/layers/logits_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,13 @@ def forward(
335335
aux_pruned_states = torch.cat(aux_pruned_states, dim=-1)
336336
hidden_states_to_store = (
337337
aux_pruned_states[sample_indices]
338-
if sample_indices
338+
if sample_indices is not None
339339
else aux_pruned_states
340340
)
341341
else:
342342
hidden_states_to_store = (
343343
pruned_states[sample_indices]
344-
if sample_indices
344+
if sample_indices is not None
345345
else pruned_states
346346
)
347347
else:

0 commit comments

Comments
 (0)