Instructions to use AvitoTech/SigLIP2-giant-e5small-v2-gating with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AvitoTech/SigLIP2-giant-e5small-v2-gating with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="AvitoTech/SigLIP2-giant-e5small-v2-gating", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AvitoTech/SigLIP2-giant-e5small-v2-gating", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix AutoModel loading, add image processor and Apache-2.0 license
Hi, and thanks for releasing these models.
This follows up on the report on the SigLIP2-Base repo.
- The architecture was not loadable.
config.jsonadvertised this composite checkpoint as a plainSiglipModel, soAutoModelbuilt a differently shaped model and initialised it randomly. The repo now shipsconfiguration_avito_gated.pyandmodeling_avito_gated.py-- a faithful port of theFaceRecognizerclass from the model card -- plus aconfig.jsonthat describes both towers. Tensor names are unchanged, so existingload_state_dictcode keeps working.
Also: the download snippet in the card points atAvitoTech/SigLIP2-giant-e5small-v2-gating-for-animal-identification, which 404s. It now points here. - Image processor. Added
preprocessor_config.json, copied unchanged fromgoogle/siglip2-giant-opt-patch16-384, so the repo is self-contained and the card no longer has to send users to another repository for preprocessing. - License. Added
license: apache-2.0and aLICENSEfile (see below).
Verification
The reference is the wrapper this checkpoint was trained with: it is built fromgoogle/siglip2-giant-opt-patch16-384 and loaded from the published model.safetensors withload_state_dict(strict=True) (0 missing / 0 unexpected keys). Its embeddings are then
compared against AutoModel.from_pretrained on the files in this PR.
| check | result |
|---|---|
| missing / unexpected / mismatched keys | 0 / 0 / 0 |
| max abs difference vs. that reference | 0.0 |
| embedding dimensionality | 512 |
image processor output vs. google/siglip2-giant-opt-patch16-384 |
identical (max abs diff 0.0) |
No weight values change anywhere in this PR.
About the license
The repository currently has no license field and no LICENSE file, which is what prompted
the original question. This PR proposes Apache-2.0, matching the other public AvitoTech
models on the Hub and the Apache-2.0 base model(s) this is derived from -- but that call is
yours. If you would rather use different terms, say so and I will amend the PR; if you would
rather add the license yourself, feel free to drop the LICENSE file and the frontmatter
line from this PR and take just the loading fix.