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
@@ -357,6 +357,7 @@ class MultiModalConfig:
|
||||
Returns:
|
||||
The kwargs to build the config with, unchanged unless the flag adds
|
||||
a `device`.
|
||||
|
||||
"""
|
||||
if mm_processor_device in (None, "auto"):
|
||||
return mm_processor_kwargs
|
||||
@@ -390,6 +391,7 @@ class MultiModalConfig:
|
||||
ValueError: If `device` is not something `torch.device` accepts.
|
||||
`validate_mm_processor_device` is what surfaces this during
|
||||
startup, so the value is only parsed once.
|
||||
|
||||
"""
|
||||
device = (self.mm_processor_kwargs or {}).get("device")
|
||||
if device is None:
|
||||
@@ -418,6 +420,7 @@ class MultiModalConfig:
|
||||
ValueError: If the requested device is not a torch device, or if it
|
||||
is the accelerator on an instance that also runs the language
|
||||
model.
|
||||
|
||||
"""
|
||||
from vllm.platforms import current_platform
|
||||
|
||||
@@ -452,8 +455,7 @@ class MultiModalConfig:
|
||||
)
|
||||
|
||||
def compute_hash(self) -> str:
|
||||
"""
|
||||
WARNING: Whenever a new field is added to this config,
|
||||
"""WARNING: Whenever a new field is added to this config,
|
||||
ensure that it is included in the factors list if
|
||||
it affects the computation graph.
|
||||
|
||||
@@ -476,8 +478,7 @@ class MultiModalConfig:
|
||||
return hash_str
|
||||
|
||||
def get_limit_per_prompt(self, modality: str) -> int:
|
||||
"""
|
||||
Get the maximum number of input items allowed per prompt
|
||||
"""Get the maximum number of input items allowed per prompt
|
||||
for the given modality (backward compatible).
|
||||
"""
|
||||
if self.language_model_only:
|
||||
@@ -495,8 +496,7 @@ class MultiModalConfig:
|
||||
self,
|
||||
inference_kwargs: Mapping[str, object],
|
||||
) -> dict[str, object]:
|
||||
"""
|
||||
Get the keyword arguments to pass to the multi-modal processor
|
||||
"""Get the keyword arguments to pass to the multi-modal processor
|
||||
according to the extra arguments passed during inference.
|
||||
"""
|
||||
kwargs = self.mm_processor_kwargs or {}
|
||||
@@ -524,7 +524,8 @@ class MultiModalConfig:
|
||||
|
||||
def get_video_pruning_spec(self) -> tuple[VideoPruningMethod, float] | None:
|
||||
"""Return `(method, rate)` when video pruning is enabled, else None.
|
||||
`rate` is the fraction of video tokens to prune."""
|
||||
`rate` is the fraction of video tokens to prune.
|
||||
"""
|
||||
if self.video_pruning_rate is not None and self.video_pruning_rate > 0:
|
||||
return (self.video_pruning_method, float(self.video_pruning_rate))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user