Instructions to use kerasformers/gemma-4-e2b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use kerasformers/gemma-4-e2b-it with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use kerasformers/gemma-4-e2b-it with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://kerasformers/gemma-4-e2b-it") - Notebooks
- Google Colab
- Kaggle
| { | |
| "library_name": "kerasformers", | |
| "kerasformers_version": "1.2.1", | |
| "model_module": "kerasformers.models.gemma4", | |
| "model_class": "Gemma4ConditionalGenerate", | |
| "variant": "gemma-4-e2b-it", | |
| "weights": "model.weights.json", | |
| "schema_version": 2, | |
| "weight_dtype": "bfloat16", | |
| "model_type": "gemma4", | |
| "text_config": { | |
| "vocab_size": 262144, | |
| "embed_dim": 1536, | |
| "mlp_dim": 6144, | |
| "num_layers": 35, | |
| "num_heads": 8, | |
| "num_kv_heads": 1, | |
| "num_global_kv_heads": 1, | |
| "head_dim": 256, | |
| "global_head_dim": 512, | |
| "k_eq_v": false, | |
| "enable_moe": false, | |
| "num_experts": 0, | |
| "num_experts_per_tok": 0, | |
| "moe_mlp_dim": 0, | |
| "sliding_window": 512, | |
| "sliding_window_pattern": 6, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "partial_rotary_factor": 0.25, | |
| "final_logit_softcapping": 30.0, | |
| "norm_eps": 1e-06, | |
| "rope_theta": 1000000.0, | |
| "rope_local_theta": 10000.0, | |
| "tie_embeddings": true, | |
| "hidden_size_per_layer_input": 256, | |
| "vocab_size_per_layer_input": 262144, | |
| "num_kv_shared_layers": 20, | |
| "use_double_wide_mlp": true | |
| }, | |
| "vision_config": { | |
| "hidden_size": 768, | |
| "num_layers": 16, | |
| "num_heads": 12, | |
| "num_kv_heads": 12, | |
| "head_dim": 64, | |
| "intermediate_size": 3072, | |
| "patch_size": 16, | |
| "position_embedding_size": 10240, | |
| "pooling_kernel_size": 3, | |
| "rope_theta": 100.0, | |
| "eps": 1e-06, | |
| "standardize": false, | |
| "use_clipped_linears": true | |
| }, | |
| "audio_config": { | |
| "hidden_size": 1024, | |
| "num_layers": 12, | |
| "num_heads": 8, | |
| "conv_channels": [ | |
| 128, | |
| 32 | |
| ], | |
| "conv_kernel_size": 5, | |
| "chunk_size": 12, | |
| "context_left": 13, | |
| "context_right": 0, | |
| "logit_cap": 50.0, | |
| "invalid_logits": -1000000000.0, | |
| "residual_weight": 0.5, | |
| "norm_eps": 1e-06, | |
| "output_proj_dims": 1536, | |
| "use_clipped_linears": true | |
| }, | |
| "image_token_id": 258880, | |
| "video_token_id": 258884, | |
| "audio_token_id": 258881, | |
| "pad_token_id": 0, | |
| "use_bidirectional_vision": false | |
| } | |