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:
Harry Mellor
2026-09-16 16:44:29 +00:00
committed by GitHub
co-authored by Claude Opus 5
parent 804e5377aa
commit 8c1557a79c
2002 changed files with 15024 additions and 14269 deletions
+5 -4
View File
@@ -45,7 +45,7 @@ class MinPLogitsProcessor(LogitsProcessor):
self.min_p: torch.Tensor = self.min_p_device[:0]
def is_argmax_invariant(self) -> bool:
"""Min-p never impacts greedy sampling"""
"""Min-p never impacts greedy sampling."""
return True
def get_min_p_by_index(self, index: int) -> float:
@@ -129,7 +129,8 @@ class LogitBiasLogitsProcessor(LogitsProcessor):
def is_argmax_invariant(self) -> bool:
"""Logit bias can rebalance token probabilities and change the
outcome of argmax in greedy sampling."""
outcome of argmax in greedy sampling.
"""
return False
def update_state(self, batch_update: BatchUpdate | None):
@@ -188,7 +189,8 @@ class MinTokensLogitsProcessor(LogitsProcessor):
def is_argmax_invariant(self) -> bool:
"""By censoring stop tokens, min-tokens can change the outcome
of the argmax operation in greedy sampling."""
of the argmax operation in greedy sampling.
"""
return False
@staticmethod
@@ -377,7 +379,6 @@ def process_dict_updates(
new_state: Callable[[SamplingParams, list[int] | None, list[int]], T | None],
) -> bool:
"""Utility function to update dict state for sparse LogitsProcessors."""
if not batch_update:
# Nothing to do.
return False