Instructions to use zeromodels/modernbert_large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/modernbert_large 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/modernbert_large") - Keras
How to use zeromodels/modernbert_large with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/modernbert_large") - Notebooks
- Google Colab
- Kaggle
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
9dfa8b8 verified | { | |
| "library_name": "zeromodels", | |
| "zeromodels_version": "1.2.3", | |
| "model_module": "zeromodels.models.modernbert", | |
| "model_class": "ModernBertModel", | |
| "variant": "modernbert_large", | |
| "weights": "model.weights.h5", | |
| "schema_version": 2, | |
| "weight_dtype": "float32", | |
| "model_type": "modernbert", | |
| "text_config": { | |
| "vocab_size": 50368, | |
| "embed_dim": 1024, | |
| "num_layers": 28, | |
| "num_heads": 16, | |
| "mlp_dim": 2624, | |
| "max_position_embeddings": 8192, | |
| "hidden_act": "gelu", | |
| "norm_eps": 1e-05, | |
| "local_attention": 128, | |
| "global_attn_every_n_layers": 3, | |
| "global_rope_theta": 160000.0, | |
| "local_rope_theta": 10000.0, | |
| "pad_token_id": 50283 | |
| } | |
| } |