Instructions to use unsloth/gemma-4-E2B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use unsloth/gemma-4-E2B-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/gemma-4-E2B-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/gemma-4-E2B-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/gemma-4-E2B-it to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="unsloth/gemma-4-E2B-it", max_seq_length=2048, )
Upload folder using huggingface_hub
Browse files- README.md +11 -15
- config.json +2 -2
- generation_config.json +1 -1
- model-00002-of-00003.safetensors +0 -3
- model-00003-of-00003.safetensors +0 -3
- model-00001-of-00003.safetensors → model.safetensors +2 -2
- model.safetensors.index.json +0 -0
- processor_config.json +1 -1
- tokenizer_config.json +2 -2
README.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
license_link: https://ai.google.dev/gemma/docs/gemma_4_license
|
| 4 |
-
pipeline_tag: image-text-to-text
|
| 5 |
-
base_model: google/gemma-4-E2B-it
|
| 6 |
tags:
|
| 7 |
-
- gemma4
|
| 8 |
- unsloth
|
| 9 |
-
|
| 10 |
-
- google
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
<div>
|
| 15 |
<p style="margin-top: 0;margin-bottom: 0;">
|
| 16 |
-
|
| 17 |
</p>
|
| 18 |
<div style="display: flex; gap: 5px; align-items: center; ">
|
| 19 |
<a href="https://github.com/unslothai/unsloth/">
|
|
@@ -22,17 +23,12 @@ tags:
|
|
| 22 |
<a href="https://discord.gg/unsloth">
|
| 23 |
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
| 24 |
</a>
|
| 25 |
-
<a href="https://unsloth.ai/
|
| 26 |
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
| 27 |
</a>
|
| 28 |
</div>
|
| 29 |
</div>
|
| 30 |
|
| 31 |
-
Gemma 4 can now be run and fine-tuned in [Unsloth Studio](https://unsloth.ai/docs/new/studio). [Read our guide](https://unsloth.ai/docs/models/gemma-4).
|
| 32 |
-
|
| 33 |
-
See all versions of Gemma 4 (GGUF, 16-bit etc.) [in our collection](https://huggingface.co/collections/unsloth/gemma-4).
|
| 34 |
-
|
| 35 |
-
---
|
| 36 |
|
| 37 |
<div align="center">
|
| 38 |
<img src=https://ai.google.dev/gemma/images/gemma4_banner.png>
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
|
|
|
| 3 |
- unsloth
|
| 4 |
+
base_model:
|
| 5 |
+
- google/gemma-4-E2B-it
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
license_link: https://ai.google.dev/gemma/docs/gemma_4_license
|
| 9 |
+
pipeline_tag: any-to-any
|
| 10 |
---
|
| 11 |
+
> [!NOTE]
|
| 12 |
+
> Includes Unsloth **chat template fixes**! <br> For `llama.cpp`, use `--jinja`
|
| 13 |
+
>
|
| 14 |
|
| 15 |
<div>
|
| 16 |
<p style="margin-top: 0;margin-bottom: 0;">
|
| 17 |
+
<em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
|
| 18 |
</p>
|
| 19 |
<div style="display: flex; gap: 5px; align-items: center; ">
|
| 20 |
<a href="https://github.com/unslothai/unsloth/">
|
|
|
|
| 23 |
<a href="https://discord.gg/unsloth">
|
| 24 |
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
| 25 |
</a>
|
| 26 |
+
<a href="https://docs.unsloth.ai/">
|
| 27 |
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
| 28 |
</a>
|
| 29 |
</div>
|
| 30 |
</div>
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
<div align="center">
|
| 34 |
<img src=https://ai.google.dev/gemma/images/gemma4_banner.png>
|
config.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
| 49 |
"eoa_token_id": 258883,
|
| 50 |
"eoa_token_index": 258883,
|
| 51 |
"eoi_token_id": 258882,
|
| 52 |
-
"eos_token_id":
|
| 53 |
"image_token_id": 258880,
|
| 54 |
"initializer_range": 0.02,
|
| 55 |
"model_type": "gemma4",
|
|
@@ -187,4 +187,4 @@
|
|
| 187 |
"use_clipped_linears": true
|
| 188 |
},
|
| 189 |
"vision_soft_tokens_per_image": 280
|
| 190 |
-
}
|
|
|
|
| 49 |
"eoa_token_id": 258883,
|
| 50 |
"eoa_token_index": 258883,
|
| 51 |
"eoi_token_id": 258882,
|
| 52 |
+
"eos_token_id": 106,
|
| 53 |
"image_token_id": 258880,
|
| 54 |
"initializer_range": 0.02,
|
| 55 |
"model_type": "gemma4",
|
|
|
|
| 187 |
"use_clipped_linears": true
|
| 188 |
},
|
| 189 |
"vision_soft_tokens_per_image": 280
|
| 190 |
+
}
|
generation_config.json
CHANGED
|
@@ -10,5 +10,5 @@
|
|
| 10 |
"temperature": 1.0,
|
| 11 |
"top_k": 64,
|
| 12 |
"top_p": 0.95,
|
| 13 |
-
"transformers_version": "5.
|
| 14 |
}
|
|
|
|
| 10 |
"temperature": 1.0,
|
| 11 |
"top_k": 64,
|
| 12 |
"top_p": 0.95,
|
| 13 |
+
"transformers_version": "5.5.0.dev0"
|
| 14 |
}
|
model-00002-of-00003.safetensors
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b07560fd5ae48bc6594433bd2c366ae2df65fd42d7d1adbd2865e169ee3ec8ea
|
| 3 |
-
size 4987105346
|
|
|
|
|
|
|
|
|
|
|
|
model-00003-of-00003.safetensors
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c09a40c769d67235595f0d8a9909f4eab6ea9f9719f17812f7285830fa951a66
|
| 3 |
-
size 3799615716
|
|
|
|
|
|
|
|
|
|
|
|
model-00001-of-00003.safetensors → model.safetensors
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2db5482b20d746879bb3ef79b5203e9075a2e2b98f54ec7c2f281c1477ddc550
|
| 3 |
+
size 10246621918
|
model.safetensors.index.json
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
| 13 |
"max_frequency": 8000.0,
|
| 14 |
"mel_floor": 0.001,
|
| 15 |
"min_frequency": 0.0,
|
| 16 |
-
"padding_side": "
|
| 17 |
"padding_value": 0.0,
|
| 18 |
"per_bin_mean": null,
|
| 19 |
"per_bin_stddev": null,
|
|
|
|
| 13 |
"max_frequency": 8000.0,
|
| 14 |
"mel_floor": 0.001,
|
| 15 |
"min_frequency": 0.0,
|
| 16 |
+
"padding_side": "right",
|
| 17 |
"padding_value": 0.0,
|
| 18 |
"per_bin_mean": null,
|
| 19 |
"per_bin_stddev": null,
|
tokenizer_config.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
"eoa_token": "<audio|>",
|
| 8 |
"eoc_token": "<channel|>",
|
| 9 |
"eoi_token": "<image|>",
|
| 10 |
-
"eos_token": "<
|
| 11 |
"eot_token": "<turn|>",
|
| 12 |
"escape_token": "<|\"|>",
|
| 13 |
"etc_token": "<tool_call|>",
|
|
@@ -17,7 +17,7 @@
|
|
| 17 |
"<|video|>"
|
| 18 |
],
|
| 19 |
"image_token": "<|image|>",
|
| 20 |
-
"is_local":
|
| 21 |
"local_files_only": false,
|
| 22 |
"mask_token": "<mask>",
|
| 23 |
"model_max_length": 131072,
|
|
|
|
| 7 |
"eoa_token": "<audio|>",
|
| 8 |
"eoc_token": "<channel|>",
|
| 9 |
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<turn|>",
|
| 11 |
"eot_token": "<turn|>",
|
| 12 |
"escape_token": "<|\"|>",
|
| 13 |
"etc_token": "<tool_call|>",
|
|
|
|
| 17 |
"<|video|>"
|
| 18 |
],
|
| 19 |
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
"local_files_only": false,
|
| 22 |
"mask_token": "<mask>",
|
| 23 |
"model_max_length": 131072,
|