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
@@ -94,11 +94,10 @@ class WhisperPosEmbedType(enum.Enum):
|
||||
|
||||
|
||||
class WhisperAudioInputs(TensorSchema):
|
||||
"""
|
||||
Dimensions:
|
||||
- b: Batch size
|
||||
- nmb: Number of mel bins
|
||||
- t: Time frames (M)
|
||||
"""Dimensions:
|
||||
- b: Batch size
|
||||
- nmb: Number of mel bins
|
||||
- t: Time frames (M)
|
||||
"""
|
||||
|
||||
input_features: Annotated[
|
||||
@@ -120,9 +119,8 @@ class WhisperEncoderAttention(MMEncoderAttention):
|
||||
# Only used for FlashInfer CuDNN backend.
|
||||
sequence_lengths: torch.Tensor | None = None,
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
Input shape: batch_size x seq_len x hidden_size
|
||||
or seq_len x hidden_size
|
||||
"""Input shape: batch_size x seq_len x hidden_size
|
||||
or seq_len x hidden_size
|
||||
"""
|
||||
is_2d = query.dim() == 2
|
||||
if is_2d:
|
||||
@@ -931,7 +929,6 @@ class WhisperForConditionalGeneration(
|
||||
Decodes the first token ID and extracts the language code from the
|
||||
``<|xx|>`` format. Expects a valid language token from constrained generation.
|
||||
"""
|
||||
|
||||
decoded = tokenizer.decode(
|
||||
[token_ids[0]],
|
||||
skip_special_tokens=False,
|
||||
@@ -1058,8 +1055,7 @@ class WhisperForConditionalGeneration(
|
||||
def _create_fake_bias_for_k_proj(
|
||||
weights: Iterable[tuple[str, torch.Tensor]], fake_bias_key_name: str
|
||||
) -> Iterable[tuple[str, torch.Tensor]]:
|
||||
"""
|
||||
Create full zeros bias for k_proj weight in self-attn and x-attn layers.
|
||||
"""Create full zeros bias for k_proj weight in self-attn and x-attn layers.
|
||||
So that the bias for k_proj in qkv_proj can be initialized with zeros.
|
||||
"""
|
||||
for name, weight in weights:
|
||||
|
||||
Reference in New Issue
Block a user