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
@@ -58,12 +58,11 @@ from .utils import (
|
||||
|
||||
|
||||
class Mistral3ImagePixelInputs(TensorSchema):
|
||||
"""
|
||||
Dimensions:
|
||||
- bn: Batch size * number of images
|
||||
- c: Number of channels (3)
|
||||
- h: Height of each image
|
||||
- w: Width of each image
|
||||
"""Dimensions:
|
||||
- bn: Batch size * number of images
|
||||
- c: Number of channels (3)
|
||||
- h: Height of each image
|
||||
- w: Width of each image
|
||||
"""
|
||||
|
||||
type: Literal["pixel_values_pixtral"] = "pixel_values_pixtral"
|
||||
@@ -77,9 +76,7 @@ class Mistral3ImagePixelInputs(TensorSchema):
|
||||
|
||||
|
||||
class Mistral3PatchMerger(nn.Module):
|
||||
"""
|
||||
Learned merging of spatial_merge_size ** 2 patches
|
||||
"""
|
||||
"""Learned merging of spatial_merge_size ** 2 patches."""
|
||||
|
||||
def __init__(
|
||||
self, vision_hidden_size: int, spatial_merge_size: int, patch_size: int
|
||||
@@ -365,6 +362,7 @@ def _get_num_hidden_layers(hf_config: Mistral3Config) -> int:
|
||||
|
||||
Args:
|
||||
hf_config: Model config with vision feature layer(s).
|
||||
|
||||
"""
|
||||
feature_layers = hf_config.vision_feature_layer
|
||||
num_hidden_layers = hf_config.vision_config.num_hidden_layers
|
||||
@@ -588,9 +586,12 @@ class Mistral3ForConditionalGeneration(
|
||||
positions: Position indices for the input tokens.
|
||||
intermediate_tensors: Intermediate tensors from prior forward pass.
|
||||
inputs_embeds: Optional tensor of input embeddings.
|
||||
**kwargs: Multimodal inputs for this batch, forwarded to the
|
||||
multimodal embedding path.
|
||||
|
||||
Info:
|
||||
[`Mistral3ImagePixelInputs`][vllm.model_executor.models.mistral3.Mistral3ImagePixelInputs]
|
||||
|
||||
"""
|
||||
if intermediate_tensors is not None:
|
||||
inputs_embeds = None
|
||||
@@ -612,9 +613,7 @@ class Mistral3ForConditionalGeneration(
|
||||
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
||||
|
||||
def get_mm_mapping(self) -> MultiModelKeys:
|
||||
"""
|
||||
Get the module prefix in multimodal models
|
||||
"""
|
||||
"""Get the module prefix in multimodal models."""
|
||||
return MultiModelKeys.from_string_field(
|
||||
language_model="language_model",
|
||||
connector="multi_modal_projector",
|
||||
|
||||
Reference in New Issue
Block a user