Instructions to use google/siglip2-giant-opt-patch16-384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/siglip2-giant-opt-patch16-384 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/siglip2-giant-opt-patch16-384") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("google/siglip2-giant-opt-patch16-384", dtype="auto") - Notebooks
- Google Colab
- Kaggle
AutoModel.from_pretrained error in loading state_dict
#3
by Srymaker - opened
same problem
I meet the same error. It seems that the text prediction head (weights and bias) shape in current transformers is [1152, 1152] while the weights the authors provided are [1536, 1152] to match the visual token output.
this version (https://github.com/huggingface/transformers/releases/tag/v4.49.0-SigLIP-2) should fix the problem


