Instructions to use AFZAL0008/LeViT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AFZAL0008/LeViT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="AFZAL0008/LeViT") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("AFZAL0008/LeViT") model = AutoModelForImageClassification.from_pretrained("AFZAL0008/LeViT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from AFZAL0008/LeViT: direct link, hf CLI and curl.
- Browser
- Download file 988 Bytes
-
https://huggingface.co/AFZAL0008/LeViT/resolve/main/config.json
- Command line
-
hf download hf://AFZAL0008/LeViT/config.json
-
curl -L -o config.json https://huggingface.co/AFZAL0008/LeViT/resolve/main/config.json
988 Bytes
| { | |
| "architectures": [ | |
| "LevitForImageClassification" | |
| ], | |
| "attention_ratio": [ | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "depths": [ | |
| 4, | |
| 4, | |
| 4 | |
| ], | |
| "down_ops": [ | |
| [ | |
| "Subsample", | |
| 32, | |
| 8, | |
| 4, | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| "Subsample", | |
| 32, | |
| 12, | |
| 4, | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| "" | |
| ], | |
| [ | |
| "" | |
| ] | |
| ], | |
| "drop_path_rate": 0, | |
| "dtype": "float32", | |
| "hidden_sizes": [ | |
| 256, | |
| 384, | |
| 512 | |
| ], | |
| "id2label": { | |
| "0": "eyelid", | |
| "1": "normal" | |
| }, | |
| "image_size": 224, | |
| "initializer_range": 0.02, | |
| "kernel_size": 3, | |
| "key_dim": [ | |
| 32, | |
| 32, | |
| 32 | |
| ], | |
| "label2id": { | |
| "eyelid": 0, | |
| "normal": 1 | |
| }, | |
| "mlp_ratio": [ | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "model_type": "levit", | |
| "num_attention_heads": [ | |
| 4, | |
| 6, | |
| 8 | |
| ], | |
| "num_channels": 3, | |
| "padding": 1, | |
| "patch_size": 16, | |
| "problem_type": "single_label_classification", | |
| "stride": 2, | |
| "transformers_version": "5.22.1", | |
| "use_cache": false | |
| } | |