Instructions to use waelhasan/clip-vit-base-patch32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use waelhasan/clip-vit-base-patch32 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="waelhasan/clip-vit-base-patch32") 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("waelhasan/clip-vit-base-patch32") model = AutoModelForImageClassification.from_pretrained("waelhasan/clip-vit-base-patch32", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "CLIPForImageClassification" | |
| ], | |
| "dtype": "float32", | |
| "id2label": { | |
| "0": "0", | |
| "1": "1" | |
| }, | |
| "initializer_factor": 1.0, | |
| "label2id": { | |
| "0": 0, | |
| "1": 1 | |
| }, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "clip", | |
| "problem_type": "single_label_classification", | |
| "projection_dim": 512, | |
| "text_config": { | |
| "add_cross_attention": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 0, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "dropout": 0.0, | |
| "dtype": "float32", | |
| "eos_token_id": 2, | |
| "finetuning_task": null, | |
| "hidden_act": "quick_gelu", | |
| "hidden_size": 512, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 2048, | |
| "is_decoder": false, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 77, | |
| "model_type": "clip_text_model", | |
| "num_attention_heads": 8, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": 1, | |
| "prefix": null, | |
| "projection_dim": 512, | |
| "pruned_heads": {}, | |
| "sep_token_id": null, | |
| "task_specific_params": null, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "torchscript": false, | |
| "use_bfloat16": false, | |
| "vocab_size": 49408 | |
| }, | |
| "transformers_version": "5.0.0", | |
| "use_cache": false, | |
| "vision_config": { | |
| "add_cross_attention": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": null, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "dropout": 0.0, | |
| "dtype": "float32", | |
| "eos_token_id": null, | |
| "finetuning_task": null, | |
| "hidden_act": "quick_gelu", | |
| "hidden_size": 768, | |
| "image_size": 224, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "is_decoder": false, | |
| "layer_norm_eps": 1e-05, | |
| "model_type": "clip_vision_model", | |
| "num_attention_heads": 12, | |
| "num_channels": 3, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": null, | |
| "patch_size": 32, | |
| "prefix": null, | |
| "projection_dim": 512, | |
| "pruned_heads": {}, | |
| "sep_token_id": null, | |
| "task_specific_params": null, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "torchscript": false, | |
| "use_bfloat16": false | |
| } | |
| } | |