Text Generation
Safetensors
MLX
mlx-lm
gemma4_text
cellgemma
gemma4
biology
perturbation
4-bit precision
Instructions to use pratikgx/cellgemma-e4b-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use pratikgx/cellgemma-e4b-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("pratikgx/cellgemma-e4b-MLX-4bit") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use pratikgx/cellgemma-e4b-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "pratikgx/cellgemma-e4b-MLX-4bit" --prompt "Once upon a time"
- Atomic Chat
Download config.json from pratikgx/cellgemma-e4b-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/pratikgx/cellgemma-e4b-MLX-4bit/resolve/main/config.json
- Command line
-
hf download hf://pratikgx/cellgemma-e4b-MLX-4bit/config.json
-
curl -L -o config.json https://huggingface.co/pratikgx/cellgemma-e4b-MLX-4bit/resolve/main/config.json
3.37 kB
| { | |
| "architectures": [ | |
| "Gemma4ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attention_k_eq_v": false, | |
| "audio_token_id": null, | |
| "boa_token_id": null, | |
| "boi_token_id": null, | |
| "bos_token_id": 2, | |
| "dtype": "bfloat16", | |
| "enable_moe_block": false, | |
| "eoa_token_id": null, | |
| "eoi_token_id": null, | |
| "eos_token_id": 1, | |
| "final_logit_softcapping": 30.0, | |
| "head_dim": 256, | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "hidden_size": 2560, | |
| "hidden_size_per_layer_input": 256, | |
| "image_token_id": null, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 10240, | |
| "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" | |
| ], | |
| "max_position_embeddings": 131072, | |
| "model_type": "gemma4_text", | |
| "moe_intermediate_size": null, | |
| "num_attention_heads": 8, | |
| "num_hidden_layers": 42, | |
| "num_key_value_heads": 2, | |
| "num_kv_shared_layers": 18, | |
| "pad_token_id": 0, | |
| "per_layer_config": { | |
| "05": { | |
| "head_dim": 512 | |
| }, | |
| "11": { | |
| "head_dim": 512 | |
| }, | |
| "17": { | |
| "head_dim": 512 | |
| }, | |
| "23": { | |
| "head_dim": 512 | |
| }, | |
| "29": { | |
| "head_dim": 512 | |
| }, | |
| "35": { | |
| "head_dim": 512 | |
| }, | |
| "41": { | |
| "head_dim": 512 | |
| } | |
| }, | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "full_attention": { | |
| "partial_rotary_factor": 0.25, | |
| "rope_theta": 1000000.0, | |
| "rope_type": "proportional" | |
| }, | |
| "sliding_attention": { | |
| "rope_theta": 10000.0, | |
| "rope_type": "default" | |
| } | |
| }, | |
| "sliding_window": 512, | |
| "tie_word_embeddings": true, | |
| "top_k_experts": null, | |
| "transformers_version": "5.18.0.dev0", | |
| "use_bidirectional_attention": null, | |
| "use_cache": true, | |
| "use_double_wide_mlp": false, | |
| "vocab_size": 282240, | |
| "vocab_size_per_layer_input": 282240 | |
| } |