Clamp logprob tokens with model vocab size (#14414)
This commit is contained in:
@@ -1551,6 +1551,9 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
|
|||||||
extend_input_logprob_token_ids = torch.tensor(
|
extend_input_logprob_token_ids = torch.tensor(
|
||||||
extend_input_logprob_token_ids
|
extend_input_logprob_token_ids
|
||||||
)
|
)
|
||||||
|
# Clamp placeholder or out-of-range token IDs (e.g., multimodal hashes)
|
||||||
|
# so they stay within the vocab boundary before being sent to GPU.
|
||||||
|
extend_input_logprob_token_ids.clamp_(0, self.model_config.vocab_size - 1)
|
||||||
else:
|
else:
|
||||||
extend_input_logprob_token_ids = None
|
extend_input_logprob_token_ids = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user