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 uncaught init of linear layer in clip's/siglip's for image classification models #30435

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

vasqu
Copy link
Contributor

@vasqu vasqu commented Apr 23, 2024

What does this PR do?

Fixes the uncaught initialisation of the last linear layer in ForImageClassification of Clip/Siglip, especially when using from_pretrained. More in-depth discussion at #30374. Possible failing tests are equivalence tests between tf/pt/flax; seems unrelated.

The remaining discrepancy between from_pretrained and "from_config" has yet to be resolved. I'll leave it out since it might imply bigger things than reflected here.

Fixes #30374

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@amyeroberts @Xmaster6y

Sorry, something went wrong.

…age classification"
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for fixing so quickly!

@Xmaster6y
Copy link

LGTM!

@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.

@amyeroberts
Copy link
Collaborator

@vasqu Could you push an empty commit to this branch? This should trigger the slow model tests to make sure everything's still working as expected for CLIP

@vasqu
Copy link
Contributor Author

vasqu commented Apr 24, 2024

@amyeroberts pushed an empty commit, but seems like the slow test still hasn't been triggered.

@vasqu
Copy link
Contributor Author

vasqu commented Apr 24, 2024

Oh might've been that it's just slow 😅 my bad

@amyeroberts
Copy link
Collaborator

@vasqu Slow by name, slow by nature ;) I think it was actually waiting for me to approve - it won't run automatically for non-repo maintainers for security and to save our CI as they're quite heavy tests

@vasqu
Copy link
Contributor Author

vasqu commented Apr 24, 2024

Ah, I see. Makes sense and yea, the name should've rang a bell ^^

@amyeroberts amyeroberts merged commit 5d64ae9 into huggingface:main Apr 24, 2024
21 checks passed
@amyeroberts
Copy link
Collaborator

Thanks again for fixing this!

@vasqu vasqu deleted the fix-uncaught-init-in-clip-siglip branch April 24, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad weight init dependant of a processor import
4 participants