diff --git a/src/transformers/models/siglip/modeling_siglip.py b/src/transformers/models/siglip/modeling_siglip.py index c3d32574987648..507e0768a226ef 100644 --- a/src/transformers/models/siglip/modeling_siglip.py +++ b/src/transformers/models/siglip/modeling_siglip.py @@ -283,7 +283,7 @@ def interpolate_pos_encoding(self, embeddings: torch.Tensor, height: int, width: # always interpolate when tracing to ensure the exported model works for dynamic input shapes if not torch.jit.is_tracing() and num_patches == num_positions and height == width: - return self.position_embedding + return self.position_embedding(self.position_ids) patch_pos_embed = self.position_embedding.weight.unsqueeze(0)