Zero-Shot Image Classification
Transformers
Safetensors
tipsv2
feature-extraction
vision
contrastive-learning
zero-shot
custom_code
Instructions to use nebulette/tipsv2-b14-vision-module with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nebulette/tipsv2-b14-vision-module with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="nebulette/tipsv2-b14-vision-module", trust_remote_code=True) 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("nebulette/tipsv2-b14-vision-module", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
File size: 768 Bytes
28d6428 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """TIPSv2 model configuration."""
from transformers import PretrainedConfig
class TIPSv2ImageConfig(PretrainedConfig):
"""Configuration for TIPSv2 vision-language model."""
model_type = "tipsv2"
def __init__(
self,
model_variant="base",
hidden_size=768,
patch_size=14,
image_size=448,
ffn_layer="mlp",
init_values=1.0,
num_register_tokens=1,
**kwargs,
):
super().__init__(**kwargs)
self.model_variant = model_variant
self.hidden_size = hidden_size
self.patch_size = patch_size
self.image_size = image_size
self.ffn_layer = ffn_layer
self.init_values = init_values
self.num_register_tokens = num_register_tokens
|