Minor code style fix for dllm (#14836)

This commit is contained in:
Liangsheng Yin
2025-12-11 10:35:42 +09:00
committed by GitHub
parent 312df1d6c0
commit bd7824b24d
3 changed files with 43 additions and 35 deletions

View File

@@ -832,16 +832,18 @@ class CudaGraphRunner:
graph_key = self.bs
self.graphs[graph_key].replay()
output = self.output_buffers[graph_key]
if isinstance(output, LogitsProcessorOutput):
if self.is_dllm:
next_token_logits = None
full_logits = output.full_logits[: self.raw_num_token]
else:
full_logits = None
next_token_logits = output.next_token_logits[: self.raw_num_token]
return LogitsProcessorOutput(
next_token_logits=(
output.next_token_logits[: self.raw_num_token]
if not self.is_dllm
else None
),
full_logits=(
output.full_logits[: self.raw_num_token] if self.is_dllm else None
),
next_token_logits=next_token_logits,
full_logits=full_logits,
hidden_states=(
output.hidden_states[: self.raw_num_token]
if output.hidden_states is not None