Zero-Shot Image Classification
Transformers
Safetensors
tipsv2
feature-extraction
vision
image-text
contrastive-learning
zero-shot
custom_code
Instructions to use google/tipsv2-b14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/tipsv2-b14 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/tipsv2-b14", 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("google/tipsv2-b14", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Gabriele commited on
Commit ·
f46d027
1
Parent(s): 2cf893a
Fix meta device crash: use pure Python for drop_path_rate
Browse files- image_encoder.py +1 -1
image_encoder.py
CHANGED
|
@@ -695,7 +695,7 @@ class VisionTransformer(nn.Module):
|
|
| 695 |
dpr = [drop_path_rate] * depth
|
| 696 |
else:
|
| 697 |
dpr = [
|
| 698 |
-
|
| 699 |
] # stochastic depth decay rule
|
| 700 |
|
| 701 |
if ffn_layer == "mlp":
|
|
|
|
| 695 |
dpr = [drop_path_rate] * depth
|
| 696 |
else:
|
| 697 |
dpr = [
|
| 698 |
+
drop_path_rate * i / max(depth - 1, 1) for i in range(depth)
|
| 699 |
] # stochastic depth decay rule
|
| 700 |
|
| 701 |
if ffn_layer == "mlp":
|