Skip to content

Commit

Permalink
[BugFix]: Add type check before compare for max_new_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
YangZeyu95 committed Feb 25, 2025
1 parent 4f678c8 commit 355c66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/sglang/srt/managers/schedule_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def adjust_max_prefix_ids(self):
# request has at least one token. Later, we can relax this requirement and use `input_len`.
max_prefix_len = input_len - 1

if self.sampling_params.max_new_tokens > 0:
if (self.sampling_params.max_new_tokens or 0) > 0:
# Need at least one token to compute logits
max_prefix_len = min(max_prefix_len, input_len - 1)

Expand Down

0 comments on commit 355c66d

Please sign in to comment.