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
@@ -295,6 +295,7 @@ class Moondream3VisionEncoder(nn.Module):
|
||||
|
||||
Returns:
|
||||
patches: (batch, num_patches, patch_dim)
|
||||
|
||||
"""
|
||||
patch_size = self.config.enc_patch_size
|
||||
batch, channels, height, width = images.shape
|
||||
@@ -321,6 +322,7 @@ class Moondream3VisionEncoder(nn.Module):
|
||||
|
||||
Returns:
|
||||
features: (batch, num_patches, hidden_size)
|
||||
|
||||
"""
|
||||
# Create patches and embed
|
||||
patches = self.create_patches(pixel_values)
|
||||
@@ -489,7 +491,6 @@ class Moondream3TextMoE(nn.Module):
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
"""Forward pass with expert parallelism and custom GeGLU activation."""
|
||||
|
||||
# Get router logits and compute top-k
|
||||
router_logits, _ = self.gate(x) # [num_tokens, num_experts]
|
||||
topk_logits, topk_ids = torch.topk(
|
||||
@@ -1318,7 +1319,6 @@ class Moondream3ForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
|
||||
|
||||
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
||||
"""Load weights with remapping from HuggingFace format."""
|
||||
|
||||
params_dict = dict(self.named_parameters())
|
||||
loaded_params: set[str] = set()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user