Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -60,6 +60,7 @@ class GenerativeScoringRequest(OpenAIBaseModel):
|
||||
the full vocab for those ids (False).
|
||||
item_first: If True, prepend items to query. Otherwise append items to query.
|
||||
add_special_tokens: Whether to add special tokens when tokenizing.
|
||||
|
||||
"""
|
||||
|
||||
model: str | None = None
|
||||
@@ -112,6 +113,7 @@ class GenerativeScoringItemResult(OpenAIBaseModel):
|
||||
index: The index of this item in the input items list.
|
||||
object: Type of object, always "score".
|
||||
score: The probability score for the first label token.
|
||||
|
||||
"""
|
||||
|
||||
index: int
|
||||
@@ -129,6 +131,7 @@ class GenerativeScoringResponse(OpenAIBaseModel):
|
||||
model: The model used for scoring.
|
||||
data: List of scoring results, one per input item.
|
||||
usage: Token usage information.
|
||||
|
||||
"""
|
||||
|
||||
id: str = Field(default="")
|
||||
@@ -188,6 +191,7 @@ class ServingGenerativeScoring(BaseServing):
|
||||
Returns:
|
||||
GenerativeScoringResponse with probabilities for each item, or
|
||||
ErrorResponse if an error occurred.
|
||||
|
||||
"""
|
||||
# Check model
|
||||
error_check_ret = await self._check_model(request) # type: ignore[arg-type]
|
||||
@@ -401,6 +405,7 @@ class ServingGenerativeScoring(BaseServing):
|
||||
|
||||
Returns:
|
||||
Tuple of (list of EngineInput, list of prompt token counts).
|
||||
|
||||
"""
|
||||
# Tokenize query if it's a string
|
||||
if isinstance(request.query, str):
|
||||
@@ -455,6 +460,7 @@ class ServingGenerativeScoring(BaseServing):
|
||||
|
||||
Returns:
|
||||
Dictionary mapping token_id to probability.
|
||||
|
||||
"""
|
||||
if apply_softmax:
|
||||
# Normalize over only the label tokens (subset softmax)
|
||||
|
||||
Reference in New Issue
Block a user