Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SigLip classification doctest #30475

Conversation

amyeroberts
Copy link
Collaborator

@amyeroberts amyeroberts commented Apr 25, 2024

What does this PR do?

Fixes doctest for SigLip model.

#30435 fixed the initialization bug for the classification head, making sure it was randomly initialized using the normal_ init method. Previously, the weight was created using torch.empty because of the fast_init logic and never properly filled. This meant the array was almost always mostly 0s, leading to the stable label 0 prediction AND the seed never had an effect.

@amyeroberts amyeroberts requested a review from ydshieh April 25, 2024 08:55
@amyeroberts amyeroberts removed the request for review from ydshieh April 25, 2024 08:56
@amyeroberts amyeroberts requested a review from ydshieh April 25, 2024 08:58
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the quick fix!

@amyeroberts amyeroberts merged commit 4fed29e into huggingface:main Apr 25, 2024
10 checks passed
@amyeroberts amyeroberts deleted the fix-siglip-docstest-classification-head-init branch April 25, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants