Instructions to use zeromodels/gemma-4-e4b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/gemma-4-e4b-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 zeromodels/gemma-4-e4b-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://zeromodels/gemma-4-e4b-it") - Notebooks
- Google Colab
- Kaggle
File size: 3,115 Bytes
2f8d1d2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | {
"library_name": "kerasformers",
"kerasformers_version": "1.2.1",
"model_module": "kerasformers.models.gemma4",
"model_class": "Gemma4ConditionalGenerate",
"variant": "gemma-4-e4b-it",
"weights": "model.weights.json",
"schema_version": 2,
"weight_dtype": "bfloat16",
"model_type": "gemma4",
"text_config": {
"vocab_size": 262144,
"embed_dim": 2560,
"mlp_dim": 10240,
"num_layers": 42,
"num_heads": 8,
"num_kv_heads": 2,
"num_global_kv_heads": 2,
"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",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_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": 18,
"use_double_wide_mlp": false
},
"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
}
|