Minor follow-up fixes for the logprob refactor (#2670)
This commit is contained in:
@@ -35,21 +35,21 @@ from sglang.srt.model_executor.forward_batch_info import (
|
||||
|
||||
@dataclasses.dataclass
|
||||
class LogitsProcessorOutput:
|
||||
## First part. This part will be returned by python/sglang/srt/layers/logits_processor.py::LogitsProcessor.
|
||||
## Part 1: This part will be assigned in python/sglang/srt/layers/logits_processor.py::LogitsProcessor
|
||||
# The logits of the next tokens. shape: [#seq, vocab_size]
|
||||
next_token_logits: torch.Tensor
|
||||
# Used by speculative decoding (EAGLE)
|
||||
# The last hidden layers
|
||||
hidden_states: Optional[torch.Tensor] = None
|
||||
|
||||
## Second part. This part will be returned by python/sglang/srt/layers/sampler.py::Sampler.
|
||||
## Part 2: This part will be assigned in python/sglang/srt/layers/sampler.py::Sampler
|
||||
# The logprobs of the next tokens. shape: [#seq]
|
||||
next_token_logprobs: Optional[torch.Tensor] = None
|
||||
# The logprobs and ids of the top-k tokens in output positions. shape: [#seq, k]
|
||||
next_token_top_logprobs_val: Optional[List] = None
|
||||
next_token_top_logprobs_idx: Optional[List] = None
|
||||
|
||||
## Third part. This part will be returned by python/sglang/srt/layers/logits_processor.py::LogitsProcessor. Prefill-only.
|
||||
## Part 3: Prefill-only. This part will be assigned in python/sglang/srt/layers/logits_processor.py::LogitsProcessor
|
||||
# The normlaized logprobs of prompts. shape: [#seq]
|
||||
normalized_prompt_logprobs: torch.Tensor = None
|
||||
# The logprobs of input tokens. shape: [#token]
|
||||
|
||||
Reference in New Issue
Block a user