Instructions to use facebook/metaclip-2-worldwide-huge-378 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/metaclip-2-worldwide-huge-378 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="facebook/metaclip-2-worldwide-huge-378") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("facebook/metaclip-2-worldwide-huge-378") model = AutoModel.from_pretrained("facebook/metaclip-2-worldwide-huge-378", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "MetaCLIP2Model" | |
| ], | |
| "initializer_factor": 1.0, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "metaclip_2", | |
| "projection_dim": 1024, | |
| "text_config": { | |
| "attention_dropout": 0.0, | |
| "eos_token_id": 2, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1024, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 77, | |
| "model_type": "metaclip_2_text_model", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 24, | |
| "projection_dim": 1024, | |
| "vocab_size": 901629 | |
| }, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.55.0.dev0", | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1280, | |
| "image_size": 378, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 5120, | |
| "layer_norm_eps": 1e-05, | |
| "model_type": "metaclip_2_vision_model", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 32, | |
| "patch_size": 14, | |
| "projection_dim": 1024 | |
| } | |
| } | |