[Core] Adding token ranks along with logprobs (#3516)
Co-authored-by: Swapnil Parekh <swapnilp@ibm.com>
This commit is contained in:
@@ -16,8 +16,15 @@ if TYPE_CHECKING:
|
||||
|
||||
@dataclass
|
||||
class Logprob:
|
||||
"""Infos for supporting OpenAI compatible logprobs."""
|
||||
"""Infos for supporting OpenAI compatible logprobs and token ranks.
|
||||
|
||||
Attributes:
|
||||
logprob: The logprob of chosen token
|
||||
rank: The vocab rank of chosen token (>=1)
|
||||
decoded_token: The decoded chosen token index
|
||||
"""
|
||||
logprob: float
|
||||
rank: Optional[int] = None
|
||||
decoded_token: Optional[str] = None
|
||||
|
||||
|
||||
@@ -66,7 +73,7 @@ class SequenceStatus(enum.Enum):
|
||||
class RequestMetrics:
|
||||
"""Metrics associated with a request.
|
||||
|
||||
Args:
|
||||
Attributes:
|
||||
arrival_time: The time when the request arrived.
|
||||
first_scheduled_time: The time when the request was first scheduled.
|
||||
first_token_time: The time when the first token was generated.
|
||||
|
||||
Reference in New Issue
Block a user