Instructions to use zeromodels/levit-256 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/levit-256 with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/levit-256") - Keras
How to use zeromodels/levit-256 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/levit-256") - Notebooks
- Google Colab
- Kaggle
Download zm_config.json from zeromodels/levit-256: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/zeromodels/levit-256/resolve/main/zm_config.json
- Command line
-
hf download hf://zeromodels/levit-256/zm_config.json
-
curl -L -o zm_config.json https://huggingface.co/zeromodels/levit-256/resolve/main/zm_config.json
847 Bytes
| { | |
| "library_name": "zeromodels", | |
| "zeromodels_version": "1.2.7", | |
| "model_module": "zeromodels.models.levit", | |
| "model_class": "LevitImageClassify", | |
| "variant": "levit-256", | |
| "weights": "model.weights.h5", | |
| "schema_version": 2, | |
| "model_type": "levit", | |
| "vision_config": { | |
| "image_size": 224, | |
| "num_channels": 3, | |
| "kernel_size": 3, | |
| "stride": 2, | |
| "padding": 1, | |
| "patch_size": 16, | |
| "hidden_sizes": [ | |
| 256, | |
| 384, | |
| 512 | |
| ], | |
| "num_attention_heads": [ | |
| 4, | |
| 6, | |
| 8 | |
| ], | |
| "depths": [ | |
| 4, | |
| 4, | |
| 4 | |
| ], | |
| "key_dim": [ | |
| 32, | |
| 32, | |
| 32 | |
| ], | |
| "mlp_ratio": [ | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "attention_ratio": [ | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "num_classes": 1000, | |
| "use_distillation": true | |
| } | |
| } |