Instructions to use google/siglip2-so400m-patch14-384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/siglip2-so400m-patch14-384 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/siglip2-so400m-patch14-384") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("google/siglip2-so400m-patch14-384", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Question About SigLIP 2’s Performance with Newline-Separated Labels
I’ve been experimenting with SigLIP 1 and SigLIP 2 in the Hugging Face Space and noticed something interesting. When I input labels in two formats—comma-separated (e.g., "photojournalism photography, editorial photography") versus newline-separated (e.g., "photojournalism photography,\neditorial photography,\n...")—SigLIP 1 consistently performs more accurately, while SigLIP 2 seem to perform better when there is a new line. I have also tested with diverse set of images and noticed similar pattern.
Could you shed light on why SigLIP 2 handles newline-separated labels better? Is this an intentional design choice, like training on noisier text data, or an artifact of the tokenizer?
Thank you!
This is unrelated to the model - you're using the space wrong. Do not use any newline, just comma separate the labels, nothing else.

