Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
9ad28f63
Unverified
Commit
9ad28f63
authored
Apr 26, 2025
by
aoshen524
Committed by
GitHub
Apr 26, 2025
Browse files
fix(srt): check if sample_indices is not None before usage. (#5633)
parent
d7b1ce65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python/sglang/srt/layers/logits_processor.py
python/sglang/srt/layers/logits_processor.py
+2
-2
No files found.
python/sglang/srt/layers/logits_processor.py
View file @
9ad28f63
...
@@ -335,13 +335,13 @@ class LogitsProcessor(nn.Module):
...
@@ -335,13 +335,13 @@ class LogitsProcessor(nn.Module):
aux_pruned_states
=
torch
.
cat
(
aux_pruned_states
,
dim
=-
1
)
aux_pruned_states
=
torch
.
cat
(
aux_pruned_states
,
dim
=-
1
)
hidden_states_to_store
=
(
hidden_states_to_store
=
(
aux_pruned_states
[
sample_indices
]
aux_pruned_states
[
sample_indices
]
if
sample_indices
if
sample_indices
is
not
None
else
aux_pruned_states
else
aux_pruned_states
)
)
else
:
else
:
hidden_states_to_store
=
(
hidden_states_to_store
=
(
pruned_states
[
sample_indices
]
pruned_states
[
sample_indices
]
if
sample_indices
if
sample_indices
is
not
None
else
pruned_states
else
pruned_states
)
)
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment