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
@@ -200,7 +200,7 @@ class VisualTokenizer(torch.nn.Module):
|
||||
return features
|
||||
|
||||
def forward(self, pixel_values: torch.Tensor) -> torch.Tensor:
|
||||
"""[BatchSize, ImageShape] -> [BatchSize, Token, VocabSize]"""
|
||||
"""[BatchSize, ImageShape] -> [BatchSize, Token, VocabSize]."""
|
||||
features = self.encode(pixel_values)
|
||||
logits = self.head(features)
|
||||
tokens = self.tokenize(logits)
|
||||
@@ -217,13 +217,12 @@ class VisualTokenizer(torch.nn.Module):
|
||||
|
||||
|
||||
class OvisImagePatchInputs(TensorSchema):
|
||||
"""
|
||||
Dimensions:
|
||||
- bnp: Batch size * number of images * number of patches
|
||||
- h: Height of each patch
|
||||
- w: Width of each patch
|
||||
- patch_indicators: Batch size * (number of patches + 1)
|
||||
- bn: Batch size * number of images
|
||||
"""Dimensions:
|
||||
- bnp: Batch size * number of images * number of patches
|
||||
- h: Height of each patch
|
||||
- w: Width of each patch
|
||||
- patch_indicators: Batch size * (number of patches + 1)
|
||||
- bn: Batch size * number of images
|
||||
"""
|
||||
|
||||
type: Literal["image_patches"]
|
||||
@@ -331,8 +330,7 @@ class OvisMultiModalProcessor(BaseMultiModalProcessor[OvisProcessingInfo]):
|
||||
self,
|
||||
image_indicators: list[int],
|
||||
) -> list[int]:
|
||||
"""
|
||||
Filter image indicators placeholders and convert them to corresponding
|
||||
"""Filter image indicators placeholders and convert them to corresponding
|
||||
tokens in visual tokenizer.
|
||||
For example, [-301, -300, -302, -300, -303, -300, -304, -300, -305]
|
||||
should return [vocab_size-1, vocab_size-2, ..., vocab_size-5]
|
||||
|
||||
Reference in New Issue
Block a user