Skip to content

Add TinyCLIP #2113

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

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Add TinyCLIP #2113

merged 3 commits into from
Mar 20, 2024

Conversation

gau-nernst
Copy link
Contributor

@gau-nernst gau-nernst commented Mar 18, 2024

Close #2025

Ref: https://github.com/microsoft/Cream/tree/main/TinyCLIP

Auto-pruned variants (63M, 45M, 22M) have irregular structure (different head dim at each layer) so it's not possible to integrate them easily.

@rwightman Also, TinyCLIP weights are in float16, so resample patch embed and pos embed will fail. Should I add a cast to float32 to these functions?

@gau-nernst gau-nernst marked this pull request as ready for review March 18, 2024 23:32
@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.

@rwightman
Copy link
Collaborator

@gau-nernst FYI, thinking about the naming here... the 39/40M model defs are actually the same as my 'medium' that I've been using a while (and have more weights pending release). Also in OpenCLIP https://github.com/mlfoundations/open_clip/blob/main/src/open_clip/model_configs/ViT-M-16.json

I also have a few embed=640, heads=10 weights lying around that I hadn't named yet but was calling medium+ in my refs.

So I'm going to have a moment to think about the naming...

@rwightman
Copy link
Collaborator

rwightman commented Mar 19, 2024

Ideas in slotting names within current vit sizing...

name - width, heads, depth
vit_tiny - 192, 3, 12
vit_xsmall, ? - 256, 4, 10
vit_small - 384, 6, 12
vit_medium - 512, 8, 12
vit_betwixt, vit_mediumw, vit_mediump, ? - 640, 10, 12 (w=wide, p=plus)
vit_base - 768, 12, 12
vit_large - 1024, 16, 24

…tly mapped OpenCLIP compatible checkpoint on hf hub
@rwightman rwightman merged commit 492947d into huggingface:main Mar 20, 2024
22 checks passed
@gau-nernst gau-nernst deleted the tinyclip branch March 20, 2024 23:32
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.

[FEATURE] Add TinyCLIP
3 participants