Skip to content

Commit

Permalink
🚨 fix(SigLip): remove spurious exclusion of first vision output token (…
Browse files Browse the repository at this point in the history
…huggingface#30952)

fix(SigLip): remove spurious exclusion of first vision output token in classifier
  • Loading branch information
transmissions11 authored and amyeroberts committed Jul 19, 2024
1 parent 6727d68 commit c84d473
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/siglip/modeling_siglip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ def forward(
sequence_output = outputs[0]

# average pool the patch tokens
sequence_output = torch.mean(sequence_output[:, 1:, :], dim=1)
sequence_output = torch.mean(sequence_output, dim=1)
# apply classifier
logits = self.classifier(sequence_output)

Expand Down

0 comments on commit c84d473

Please sign in to comment.