Instructions to use hf-internal-testing/tiny-random-CLIPForImageClassification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-CLIPForImageClassification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="hf-internal-testing/tiny-random-CLIPForImageClassification") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("hf-internal-testing/tiny-random-CLIPForImageClassification") model = AutoModelForImageClassification.from_pretrained("hf-internal-testing/tiny-random-CLIPForImageClassification") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "CLIPForImageClassification" | |
| ], | |
| "bos_token_id": 0, | |
| "eos_token_id": 1, | |
| "initializer_factor": 1.0, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "clip", | |
| "pad_token_id": 1, | |
| "projection_dim": 64, | |
| "text_config": { | |
| "attention_dropout": 0.1, | |
| "bos_token_id": 0, | |
| "dropout": 0.1, | |
| "eos_token_id": 1, | |
| "hidden_size": 32, | |
| "intermediate_size": 37, | |
| "max_position_embeddings": 512, | |
| "model_type": "clip_text_model", | |
| "num_attention_heads": 4, | |
| "num_hidden_layers": 2, | |
| "projection_dim": 32, | |
| "vocab_size": 1024 | |
| }, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.40.0.dev0", | |
| "vision_config": { | |
| "attention_dropout": 0.1, | |
| "dropout": 0.1, | |
| "hidden_size": 32, | |
| "image_size": 30, | |
| "intermediate_size": 37, | |
| "model_type": "clip_vision_model", | |
| "num_attention_heads": 4, | |
| "num_hidden_layers": 2, | |
| "patch_size": 2, | |
| "projection_dim": 32 | |
| } | |
| } | |