-
Notifications
You must be signed in to change notification settings - Fork 981
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combined merge PR, safetensors load & SigLIP i18n SO400m (#959)
* safetensors support when loading from hf_hub --> check .bin file first, .safetensors only if .bin not found * Add model defs & weights for new so400m i18n variant. Add a 378x378 config for the original 384x348 so400m because the patch size doesn't divide 384 properly. * pin webdataset <= 0.2.86 due to breaks, keep timm at 1.0.9 for test/train until 1.0.10 is released * Add webdataset max version to pyproject.toml as well * Cleanup safetensors load support * Update timm deps * Attempt to fix broken collect in tests * Remove collect from tests, should remove duration tracking too as it's overcomplicated --------- Co-authored-by: Mehmet Deniz Birlikci <[email protected]>
- Loading branch information
1 parent
fc5a37b
commit 921b27c
Showing
14 changed files
with
187 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pytest-split==0.8.0 | ||
pytest==7.2.0 | ||
transformers[sentencepiece] | ||
timm>=1.0.7 | ||
timm>=1.0.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
torch>=1.9.0 | ||
torchvision | ||
webdataset>=0.2.5 | ||
webdataset>=0.2.5,<=0.2.86 | ||
regex | ||
ftfy | ||
tqdm | ||
pandas | ||
braceexpand | ||
huggingface_hub | ||
safetensors | ||
transformers[sentencepiece] | ||
timm>=1.0.7 | ||
timm>=1.0.10 | ||
fsspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ regex | |
ftfy | ||
tqdm | ||
huggingface_hub | ||
safetensors | ||
timm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"embed_dim": 1152, | ||
"init_logit_bias": -10, | ||
"custom_text": true, | ||
"vision_cfg": { | ||
"image_size": 378, | ||
"timm_model_name": "vit_so400m_patch14_siglip_378", | ||
"timm_model_pretrained": false, | ||
"timm_pool": "map", | ||
"timm_proj": "none" | ||
}, | ||
"text_cfg": { | ||
"context_length": 64, | ||
"vocab_size": 32000, | ||
"hf_tokenizer_name": "timm/ViT-B-16-SigLIP", | ||
"tokenizer_kwargs": { | ||
"clean": "canonicalize" | ||
}, | ||
"width": 1152, | ||
"heads": 16, | ||
"layers": 27, | ||
"mlp_ratio": 3.7362, | ||
"no_causal_mask": true, | ||
"proj_bias": true, | ||
"pool_type": "last", | ||
"norm_kwargs":{ | ||
"eps": 1e-6 | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/open_clip/model_configs/ViT-SO400M-16-SigLIP-i18n-256.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"embed_dim": 1152, | ||
"init_logit_bias": -10, | ||
"custom_text": true, | ||
"vision_cfg": { | ||
"image_size": 256, | ||
"timm_model_name": "vit_so400m_patch16_siglip_256", | ||
"timm_model_pretrained": false, | ||
"timm_pool": "map", | ||
"timm_proj": "none" | ||
}, | ||
"text_cfg": { | ||
"context_length": 64, | ||
"vocab_size": 250000, | ||
"hf_tokenizer_name": "timm/ViT-B-16-SigLIP-i18n-256", | ||
"tokenizer_kwargs": { | ||
"clean": "canonicalize" | ||
}, | ||
"width": 1152, | ||
"heads": 16, | ||
"layers": 27, | ||
"mlp_ratio": 3.7362, | ||
"no_causal_mask": true, | ||
"pool_type": "last", | ||
"proj_type": "none", | ||
"norm_kwargs":{ | ||
"eps": 1e-6 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.