Zero-Shot Image Classification
Transformers
Safetensors
tipsv2
feature-extraction
vision
image-text
contrastive-learning
zero-shot
custom_code
Instructions to use google/tipsv2-g14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/tipsv2-g14 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/tipsv2-g14", trust_remote_code=True) 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 AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("google/tipsv2-g14", trust_remote_code=True) model = AutoModel.from_pretrained("google/tipsv2-g14", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Gabriele commited on
Commit ·
1785a7e
1
Parent(s): ee929f8
Fix meta device crash: use pure Python for drop_path_rate
Browse files694 unmodified lines695696697698699700701694 unmodified linesdpr = [drop_path_rate] * depthelse:dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth)] # stochastic depth decay ruleif ffn_layer == "mlp":694 unmodified lines695696697698699700701694 unmodified linesdpr = [drop_path_rate] * depthelse:dpr = [drop_path_rate * i / max(depth - 1, 1) for i in range(depth)] # stochastic depth decay ruleif ffn_layer == "mlp":
image_encoder.py+1-1