Instructions to use optimum-internal-testing/tiny-random-metaclip_2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use optimum-internal-testing/tiny-random-metaclip_2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="optimum-internal-testing/tiny-random-metaclip_2") 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, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("optimum-internal-testing/tiny-random-metaclip_2") model = AutoModelForZeroShotImageClassification.from_pretrained("optimum-internal-testing/tiny-random-metaclip_2") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "MetaClip2Model" | |
| ], | |
| "dtype": "float32", | |
| "initializer_factor": 1.0, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "metaclip_2", | |
| "projection_dim": 64, | |
| "text_config": { | |
| "attention_dropout": 0.1, | |
| "bos_token_id": 0, | |
| "dropout": 0.1, | |
| "eos_token_id": 2, | |
| "hidden_act": "quick_gelu", | |
| "hidden_size": 32, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 37, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 512, | |
| "model_type": "metaclip_2_text_model", | |
| "num_attention_heads": 4, | |
| "num_hidden_layers": 5, | |
| "projection_dim": 32, | |
| "vocab_size": 1024 | |
| }, | |
| "transformers_version": "4.57.2", | |
| "vision_config": { | |
| "attention_dropout": 0.1, | |
| "bos_token_id": 0, | |
| "dropout": 0.1, | |
| "eos_token_id": 2, | |
| "hidden_act": "quick_gelu", | |
| "hidden_size": 32, | |
| "image_size": 224, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 37, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 512, | |
| "model_type": "metaclip_2_vision_model", | |
| "num_attention_heads": 4, | |
| "num_channels": 3, | |
| "num_hidden_layers": 5, | |
| "pad_token_id": 1, | |
| "patch_size": 32, | |
| "projection_dim": 32, | |
| "vocab_size": 1024 | |
| } | |
| } | |