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
+8 -9
View File
@@ -37,7 +37,8 @@ def _transformers_v4_compatibility_import():
subset of `ProcessorChatTemplateKwargs` as defined in Transformers v4.
In Transformers v5 these were merged into `ProcessorChatTemplateKwargs` and
`ChatTemplateLoadKwargs` was removed. For backward compatibility, we add an alias
for `ChatTemplateLoadKwargs` if it doesn't exist."""
for `ChatTemplateLoadKwargs` if it doesn't exist.
"""
old_import = getattr(processing_utils, "ChatTemplateLoadKwargs", None)
new_import = getattr(processing_utils, "ProcessorChatTemplateKwargs", None)
if old_import is None and new_import is not None:
@@ -52,7 +53,8 @@ def _transformers_v4_compatibility_init() -> Any:
processor instance before calling the original `ProcessorMixin.__init__`.
This can be removed if `Molmo2ForConditionalGeneration` is upstreamed to
Transformers."""
Transformers.
"""
if hasattr(ProcessorMixin.__init__, "_vllm_patched"):
return
@@ -80,9 +82,7 @@ _V = TypeVar("_V", bound=BaseVideoProcessor, default=BaseVideoProcessor)
class HashableDict(dict):
"""
A dictionary that can be hashed by lru_cache.
"""
"""A dictionary that can be hashed by lru_cache."""
# NOTE: pythonic dict is not hashable,
# we override on it directly for simplicity
@@ -91,9 +91,7 @@ class HashableDict(dict):
class HashableList(list):
"""
A list that can be hashed by lru_cache.
"""
"""A list that can be hashed by lru_cache."""
def __hash__(self) -> int: # type: ignore[override]
return hash(tuple(self))
@@ -399,7 +397,8 @@ def get_feature_extractor(
**kwargs: Any,
):
"""Load an audio feature extractor for the given model name
via HuggingFace."""
via HuggingFace.
"""
try:
processor_name = convert_model_repo_to_path(processor_name)
feature_extractor = AutoFeatureExtractor.from_pretrained(