feat: add EXL3 6.0bpw quantized weights
Browse files- .gitattributes +1 -0
- README.md +590 -0
- chat_template.jinja +365 -0
- config.json +189 -0
- generation_config.json +11 -0
- model-00001-of-00004.safetensors +3 -0
- model-00002-of-00004.safetensors +3 -0
- model-00003-of-00004.safetensors +3 -0
- model-00004-of-00004.safetensors +3 -0
- model.safetensors.index.json +0 -0
- processor_config.json +75 -0
- quantization_config.json +0 -0
- tokenizer.json +3 -0
- tokenizer_config.json +96 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,590 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Nimbz/Gemma-4-Gembrain-31B
|
| 5 |
+
tags:
|
| 6 |
+
- merge
|
| 7 |
+
- mergekit
|
| 8 |
+
- reasoning
|
| 9 |
+
- non-reasoning
|
| 10 |
+
- creative writing
|
| 11 |
+
- roleplay
|
| 12 |
+
- uncensored
|
| 13 |
+
- 31B
|
| 14 |
+
- gemma-4
|
| 15 |
+
- heretic
|
| 16 |
+
- uncensored
|
| 17 |
+
- decensored
|
| 18 |
+
- abliterated
|
| 19 |
+
- ara
|
| 20 |
+
---
|
| 21 |
+
<div style="background-color: #ff4444; color: white; padding: 20px; border-radius: 10px; text-align: center; margin: 20px 0;">
|
| 22 |
+
<h2 style="color: white; margin: 0 0 10px 0;">🚨⚠️ I HAVE REACHED HUGGING FACE'S FREE STORAGE LIMIT ⚠️🚨</h2>
|
| 23 |
+
<p style="font-size: 18px; margin: 0 0 15px 0;">I can no longer upload new models unless I can cover the cost of additional storage.<br>I host <b>70+ free models</b> as an independent contributor and this work is unpaid.<br><b>Without your support, no more new models can be uploaded.</b></p>
|
| 24 |
+
<p style="font-size: 20px; margin: 0;">
|
| 25 |
+
<a href="https://patreon.com/LLMfan46" style="color: white; text-decoration: underline;">🎉 Patreon (Monthly)</a> |
|
| 26 |
+
<a href="https://ko-fi.com/llmfan46" style="color: white; text-decoration: underline;">☕ Ko-fi (One-time)</a>
|
| 27 |
+
</p>
|
| 28 |
+
<p style="font-size: 16px; margin: 10px 0 0 0;">Every contribution goes directly toward Hugging Face storage fees to keep models free for everyone.</p>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
### **87% fewer refusals** (13/100 Uncensored vs 99/100 Original) while preserving model quality (0.0186 KL divergence).
|
| 34 |
+
|
| 35 |
+
## ❤️ Support My Work
|
| 36 |
+
Creating these models takes significant time, work and compute. If you find them useful consider supporting me:
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
|
| 40 |
+
| Platform | Link | What you get |
|
| 41 |
+
|----------|------|--------------|
|
| 42 |
+
| 🎉 Patreon | [Monthly support](https://patreon.com/LLMfan46) | Priority model requests |
|
| 43 |
+
| ☕ Ko-fi | [One-time tip](https://ko-fi.com/llmfan46) | My eternal gratitude |
|
| 44 |
+
|
| 45 |
+
Your help will motivate me and would go into further improving my workflow and coverings fees for storage, compute and may even help uncensoring bigger model with rental Cloud GPUs.
|
| 46 |
+
|
| 47 |
+
-----
|
| 48 |
+
|
| 49 |
+
# This is a decensored version of [Nimbz/Gemma-4-Gembrain-31B](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B), made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0 with the [Arbitrary-Rank Ablation (ARA)](https://github.com/p-e-w/heretic/pull/211) method
|
| 50 |
+
|
| 51 |
+
## Abliteration parameters
|
| 52 |
+
|
| 53 |
+
| Parameter | Value |
|
| 54 |
+
| :-------- | :---: |
|
| 55 |
+
| **start_layer_index** | 5 |
|
| 56 |
+
| **end_layer_index** | 60 |
|
| 57 |
+
| **preserve_good_behavior_weight** | 0.9776 |
|
| 58 |
+
| **steer_bad_behavior_weight** | 0.0002 |
|
| 59 |
+
| **overcorrect_relative_weight** | 1.0158 |
|
| 60 |
+
| **neighbor_count** | 15 |
|
| 61 |
+
|
| 62 |
+
## Targeted components
|
| 63 |
+
|
| 64 |
+
* attn.o_proj
|
| 65 |
+
|
| 66 |
+
## Performance
|
| 67 |
+
|
| 68 |
+
| Metric | This model | Original model ([Gemma-4-Gembrain-31B](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B)) |
|
| 69 |
+
| :----- | :--------: | :---------------------------: |
|
| 70 |
+
| **KL divergence** | <span style="color:darkgoldenrod">0.0186</span> | 0 *(by definition)* |
|
| 71 |
+
| **Refusals** | ✅ <span style="color:darkgreen">13/100</span> | ❌ <span style="color:blue">99/100</span> |
|
| 72 |
+
|
| 73 |
+
Lower refusals indicate fewer content restrictions, while lower KL divergence indicates more closeness to the original model's baseline. Higher refusals cause more rejections, objections, pushbacks, lecturing, censorship, softening and deflections.
|
| 74 |
+
|
| 75 |
+
## MMLU test results:
|
| 76 |
+
|
| 77 |
+
<span style="color:blue">Original:</span>
|
| 78 |
+
|
| 79 |
+
============================================================
|
| 80 |
+
|
| 81 |
+
- Total questions: 7021
|
| 82 |
+
|
| 83 |
+
- Correct: 6084
|
| 84 |
+
|
| 85 |
+
- **Accuracy: 0.8665 (86.65%)**
|
| 86 |
+
|
| 87 |
+
- Parse failures: 51
|
| 88 |
+
|
| 89 |
+
============================================================
|
| 90 |
+
|
| 91 |
+
**Tested subject scores:**
|
| 92 |
+
- professional_law: 0.7694 (604/785)
|
| 93 |
+
- moral_scenarios: 0.8326 (368/442)
|
| 94 |
+
- miscellaneous: 0.9269 (355/383)
|
| 95 |
+
- professional_psychology: 0.9051 (286/316)
|
| 96 |
+
- high_school_psychology: 0.9667 (261/270)
|
| 97 |
+
- high_school_macroeconomics: 0.9289 (183/197)
|
| 98 |
+
- elementary_mathematics: 0.9511 (175/184)
|
| 99 |
+
- moral_disputes: 0.8563 (149/174)
|
| 100 |
+
- prehistory: 0.9360 (161/172)
|
| 101 |
+
- philosophy: 0.8616 (137/159)
|
| 102 |
+
- high_school_biology: 0.9539 (145/152)
|
| 103 |
+
- professional_accounting: 0.8392 (120/143)
|
| 104 |
+
- clinical_knowledge: 0.9143 (128/140)
|
| 105 |
+
- high_school_microeconomics: 0.9706 (132/136)
|
| 106 |
+
- nutrition: 0.9259 (125/135)
|
| 107 |
+
- professional_medicine: 0.9328 (125/134)
|
| 108 |
+
- conceptual_physics: 0.9219 (118/128)
|
| 109 |
+
- high_school_mathematics: 0.5748 (73/127)
|
| 110 |
+
- human_aging: 0.8448 (98/116)
|
| 111 |
+
- security_studies: 0.8839 (99/112)
|
| 112 |
+
- high_school_statistics: 0.8919 (99/111)
|
| 113 |
+
- marketing: 0.9725 (106/109)
|
| 114 |
+
- high_school_world_history: 0.9528 (101/106)
|
| 115 |
+
- sociology: 0.8932 (92/103)
|
| 116 |
+
- high_school_government_and_politics: 0.9703 (98/101)
|
| 117 |
+
- high_school_geography: 0.9293 (92/99)
|
| 118 |
+
- high_school_chemistry: 0.7732 (75/97)
|
| 119 |
+
- high_school_us_history: 0.9368 (89/95)
|
| 120 |
+
- virology: 0.4944 (44/89)
|
| 121 |
+
- college_medicine: 0.8523 (75/88)
|
| 122 |
+
- world_religions: 0.9091 (80/88)
|
| 123 |
+
- high_school_physics: 0.7857 (66/84)
|
| 124 |
+
- electrical_engineering: 0.8642 (70/81)
|
| 125 |
+
- astronomy: 0.9494 (75/79)
|
| 126 |
+
- logical_fallacies: 0.9079 (69/76)
|
| 127 |
+
- high_school_european_history: 0.8904 (65/73)
|
| 128 |
+
- anatomy: 0.8732 (62/71)
|
| 129 |
+
- college_biology: 0.9531 (61/64)
|
| 130 |
+
- human_sexuality: 0.9219 (59/64)
|
| 131 |
+
- formal_logic: 0.7969 (51/64)
|
| 132 |
+
- public_relations: 0.7377 (45/61)
|
| 133 |
+
- international_law: 0.9167 (55/60)
|
| 134 |
+
- college_physics: 0.6842 (39/57)
|
| 135 |
+
- college_mathematics: 0.7455 (41/55)
|
| 136 |
+
- econometrics: 0.7963 (43/54)
|
| 137 |
+
- jurisprudence: 0.8679 (46/53)
|
| 138 |
+
- high_school_computer_science: 0.9808 (51/52)
|
| 139 |
+
- machine_learning: 0.8462 (44/52)
|
| 140 |
+
- medical_genetics: 0.9608 (49/51)
|
| 141 |
+
- global_facts: 0.5490 (28/51)
|
| 142 |
+
- management: 0.9200 (46/50)
|
| 143 |
+
- us_foreign_policy: 0.9200 (46/50)
|
| 144 |
+
- college_chemistry: 0.5957 (28/47)
|
| 145 |
+
- abstract_algebra: 0.7660 (36/47)
|
| 146 |
+
- business_ethics: 0.8261 (38/46)
|
| 147 |
+
- college_computer_science: 0.9333 (42/45)
|
| 148 |
+
- computer_security: 0.8372 (36/43)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
<span style="color:darkgreen">Heretic:</span>
|
| 152 |
+
|
| 153 |
+
============================================================
|
| 154 |
+
|
| 155 |
+
- Total questions: 7021
|
| 156 |
+
|
| 157 |
+
- Correct: 6031
|
| 158 |
+
|
| 159 |
+
- **Accuracy: 0.8590 (85.90%)**
|
| 160 |
+
|
| 161 |
+
- Parse failures: 43
|
| 162 |
+
|
| 163 |
+
============================================================
|
| 164 |
+
|
| 165 |
+
**Tested subject scores:**
|
| 166 |
+
- professional_law: 0.7529 (591/785)
|
| 167 |
+
- moral_scenarios: 0.8009 (354/442)
|
| 168 |
+
- miscellaneous: 0.9269 (355/383)
|
| 169 |
+
- professional_psychology: 0.8924 (282/316)
|
| 170 |
+
- high_school_psychology: 0.9667 (261/270)
|
| 171 |
+
- high_school_macroeconomics: 0.9188 (181/197)
|
| 172 |
+
- elementary_mathematics: 0.9620 (177/184)
|
| 173 |
+
- moral_disputes: 0.8506 (148/174)
|
| 174 |
+
- prehistory: 0.9302 (160/172)
|
| 175 |
+
- philosophy: 0.8553 (136/159)
|
| 176 |
+
- high_school_biology: 0.9539 (145/152)
|
| 177 |
+
- professional_accounting: 0.8252 (118/143)
|
| 178 |
+
- clinical_knowledge: 0.9071 (127/140)
|
| 179 |
+
- high_school_microeconomics: 0.9632 (131/136)
|
| 180 |
+
- nutrition: 0.9111 (123/135)
|
| 181 |
+
- professional_medicine: 0.9179 (123/134)
|
| 182 |
+
- conceptual_physics: 0.9141 (117/128)
|
| 183 |
+
- high_school_mathematics: 0.5827 (74/127)
|
| 184 |
+
- human_aging: 0.8534 (99/116)
|
| 185 |
+
- security_studies: 0.8571 (96/112)
|
| 186 |
+
- high_school_statistics: 0.8649 (96/111)
|
| 187 |
+
- marketing: 0.9633 (105/109)
|
| 188 |
+
- high_school_world_history: 0.9528 (101/106)
|
| 189 |
+
- sociology: 0.9126 (94/103)
|
| 190 |
+
- high_school_government_and_politics: 0.9703 (98/101)
|
| 191 |
+
- high_school_geography: 0.9293 (92/99)
|
| 192 |
+
- high_school_chemistry: 0.7835 (76/97)
|
| 193 |
+
- high_school_us_history: 0.9158 (87/95)
|
| 194 |
+
- virology: 0.4944 (44/89)
|
| 195 |
+
- college_medicine: 0.8409 (74/88)
|
| 196 |
+
- world_religions: 0.9091 (80/88)
|
| 197 |
+
- high_school_physics: 0.7857 (66/84)
|
| 198 |
+
- electrical_engineering: 0.8519 (69/81)
|
| 199 |
+
- astronomy: 0.9494 (75/79)
|
| 200 |
+
- logical_fallacies: 0.9211 (70/76)
|
| 201 |
+
- high_school_european_history: 0.8904 (65/73)
|
| 202 |
+
- anatomy: 0.8592 (61/71)
|
| 203 |
+
- college_biology: 0.9531 (61/64)
|
| 204 |
+
- human_sexuality: 0.8906 (57/64)
|
| 205 |
+
- formal_logic: 0.7969 (51/64)
|
| 206 |
+
- public_relations: 0.7705 (47/61)
|
| 207 |
+
- international_law: 0.9167 (55/60)
|
| 208 |
+
- college_physics: 0.7018 (40/57)
|
| 209 |
+
- college_mathematics: 0.6909 (38/55)
|
| 210 |
+
- econometrics: 0.7963 (43/54)
|
| 211 |
+
- jurisprudence: 0.8491 (45/53)
|
| 212 |
+
- high_school_computer_science: 0.9808 (51/52)
|
| 213 |
+
- machine_learning: 0.8269 (43/52)
|
| 214 |
+
- medical_genetics: 0.9216 (47/51)
|
| 215 |
+
- global_facts: 0.6078 (31/51)
|
| 216 |
+
- management: 0.9200 (46/50)
|
| 217 |
+
- us_foreign_policy: 0.9600 (48/50)
|
| 218 |
+
- college_chemistry: 0.5745 (27/47)
|
| 219 |
+
- abstract_algebra: 0.7447 (35/47)
|
| 220 |
+
- business_ethics: 0.8261 (38/46)
|
| 221 |
+
- college_computer_science: 0.9111 (41/45)
|
| 222 |
+
- computer_security: 0.8372 (36/43)
|
| 223 |
+
|
| 224 |
+
MMLU - Massive Multitask Language Understanding, multiple-choice questions across 57 subjects (math, history, law, medicine, etc.).
|
| 225 |
+
|
| 226 |
+
## GGUF Version
|
| 227 |
+
|
| 228 |
+
GGUF quantizations available here [llmfan46/Gemma-4-Gembrain-31B-it-uncensored-heretic-GGUF](https://huggingface.co/llmfan46/Gemma-4-Gembrain-31B-it-uncensored-heretic-GGUF).
|
| 229 |
+
|
| 230 |
+
-----
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
<style>
|
| 234 |
+
.gembrain-wrapper {
|
| 235 |
+
background-color: #050505;
|
| 236 |
+
color: #e2e8f0;
|
| 237 |
+
font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
| 238 |
+
padding: 30px;
|
| 239 |
+
border-radius: 20px;
|
| 240 |
+
border: 1px solid #1a1a1a;
|
| 241 |
+
line-height: 1.6;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
.neon-header { text-align: center; padding-bottom: 20px; }
|
| 245 |
+
|
| 246 |
+
.neon-title {
|
| 247 |
+
font-size: 3.5rem;
|
| 248 |
+
font-weight: 800;
|
| 249 |
+
margin: 0;
|
| 250 |
+
background: linear-gradient(90deg, #00f2ff, #ff00ff);
|
| 251 |
+
-webkit-background-clip: text;
|
| 252 |
+
-webkit-text-fill-color: transparent;
|
| 253 |
+
filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.4));
|
| 254 |
+
letter-spacing: -2px;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.crystal-card {
|
| 258 |
+
background: rgba(255, 255, 255, 0.03);
|
| 259 |
+
border-left: 4px solid #00f2ff;
|
| 260 |
+
padding: 20px;
|
| 261 |
+
margin: 20px 0;
|
| 262 |
+
border-radius: 0 12px 12px 0;
|
| 263 |
+
box-shadow: 10px 0 30px rgba(0, 242, 255, 0.05);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.magenta-card {
|
| 267 |
+
border-left-color: #ff00ff;
|
| 268 |
+
box-shadow: 10px 0 30px rgba(255, 0, 255, 0.05);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.gold-card {
|
| 272 |
+
border-left-color: #fbbf24;
|
| 273 |
+
box-shadow: 10px 0 30px rgba(251, 191, 36, 0.05);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
.stat-grid {
|
| 277 |
+
display: grid;
|
| 278 |
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
| 279 |
+
gap: 15px;
|
| 280 |
+
margin: 20px 0;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
.stat-item {
|
| 284 |
+
text-align: center;
|
| 285 |
+
padding: 15px;
|
| 286 |
+
background: #0f172a;
|
| 287 |
+
border: 1px solid #1e293b;
|
| 288 |
+
border-radius: 15px;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.stat-value {
|
| 292 |
+
display: block;
|
| 293 |
+
font-size: 1.2rem;
|
| 294 |
+
font-weight: bold;
|
| 295 |
+
color: #00f2ff;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
.thought-block {
|
| 299 |
+
background: #000;
|
| 300 |
+
border: 1px dashed #334155;
|
| 301 |
+
padding: 15px;
|
| 302 |
+
font-family: 'Courier New', Courier, monospace;
|
| 303 |
+
color: #22c55e;
|
| 304 |
+
margin-top: 10px;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
/* 5-Phase Layout */
|
| 308 |
+
.phase-grid {
|
| 309 |
+
display: flex;
|
| 310 |
+
flex-wrap: wrap;
|
| 311 |
+
gap: 15px;
|
| 312 |
+
justify-content: center;
|
| 313 |
+
margin: 20px 0;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
.phase-box {
|
| 317 |
+
flex: 1 1 calc(33% - 15px);
|
| 318 |
+
min-width: 180px;
|
| 319 |
+
background: #111;
|
| 320 |
+
padding: 15px;
|
| 321 |
+
border-radius: 10px;
|
| 322 |
+
border: 1px solid #334155;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
.tag-pill {
|
| 326 |
+
display: inline-block;
|
| 327 |
+
padding: 4px 12px;
|
| 328 |
+
border-radius: 50px;
|
| 329 |
+
font-size: 12px;
|
| 330 |
+
background: rgba(0, 242, 255, 0.1);
|
| 331 |
+
color: #00f2ff;
|
| 332 |
+
border: 1px solid rgba(0, 242, 255, 0.3);
|
| 333 |
+
margin: 5px;
|
| 334 |
+
}
|
| 335 |
+
</style>
|
| 336 |
+
|
| 337 |
+
<div class="gembrain-wrapper">
|
| 338 |
+
|
| 339 |
+
<div class="neon-header">
|
| 340 |
+
<img src="insane-in-the-gembrain-31b-title.png" width="100%" style="border-radius: 12px; border: 1px solid #333; margin-bottom: 20px;">
|
| 341 |
+
<h1 class="neon-title"> 💎 GEMBRAIN-31B 🧠 </h1>
|
| 342 |
+
<div style="color: #94a3b8; text-transform: uppercase; letter-spacing: 5px; font-size: 0.85rem; margin-top: 10px;">
|
| 343 |
+
INSANE IN THE GEMBRAIN
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
|
| 347 |
+
<div class="stat-grid">
|
| 348 |
+
<div class="stat-item"><span class="stat-value">ADHERENCE</span><span style="font-size: 0.75rem; color: #64748b;">IMPROVED</span></div>
|
| 349 |
+
<div class="stat-item"><span class="stat-value" style="color: #ff00ff;">SWIPE VARIETY</span><span style="font-size: 0.75rem; color: #64748b;">INCREASED</span></div>
|
| 350 |
+
<div class="stat-item"><span class="stat-value">CREATIVE PROSE</span><span style="font-size: 0.75rem; color: #64748b;">PRESERVED</span></div>
|
| 351 |
+
</div>
|
| 352 |
+
|
| 353 |
+
<div class="crystal-card">
|
| 354 |
+
<h3 style="color: #00f2ff; margin-top: 0;">🧠 About The Model</h3>
|
| 355 |
+
<p style="margin-bottom: 0;">Gembrain-31B is a synthesis of several models, including Gemsicle-31B as important ingredient. The goal of this release was to stabilize and improve the initial Gemsicle-31B, but also to enhance its logical and lateral thinking, both with and without reasoning.</p>
|
| 356 |
+
|
| 357 |
+
***
|
| 358 |
+
|
| 359 |
+
<p style="margin-bottom: 0;">It's build to create the most unhinged narratives and construct image prompts about anything accordingly to a given structure with high precision.</p>
|
| 360 |
+
|
| 361 |
+
***
|
| 362 |
+
|
| 363 |
+
<p style="margin-bottom: 0;">Expect creative swipe variance, unique and non-robotic prose, and sharper instruction adherence.</p>
|
| 364 |
+
</div>
|
| 365 |
+
|
| 366 |
+
<div style="display: flex; gap: 20px; flex-wrap: wrap; margin-top: 30px;">
|
| 367 |
+
<div style="flex: 1; min-width: 250px;">
|
| 368 |
+
<h2 style="color: #00f2ff; border-bottom: 1px solid #334155; padding-bottom: 5px;">🎚️ Samplers</h2>
|
| 369 |
+
<table style="width: 100%; border-collapse: collapse; font-size: 0.9rem;">
|
| 370 |
+
|
| 371 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 372 |
+
<td style="padding: 8px 5; color: #94a3b8;">Temperature</td>
|
| 373 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">1.0</td>
|
| 374 |
+
</tr>
|
| 375 |
+
|
| 376 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 377 |
+
<td style="padding: 8px 5; color: #94a3b8;">Top-K</td>
|
| 378 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0</td>
|
| 379 |
+
</tr>
|
| 380 |
+
|
| 381 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 382 |
+
<td style="padding: 8px 5; color: #94a3b8;">Top-P</td>
|
| 383 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0.95</td>
|
| 384 |
+
</tr>
|
| 385 |
+
|
| 386 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 387 |
+
<td style="padding: 8px 5; color: #94a3b8;">Min-P</td>
|
| 388 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0.03</td>
|
| 389 |
+
</tr>
|
| 390 |
+
|
| 391 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 392 |
+
<td style="padding: 8px 5; color: #94a3b8;">DRY Multiplier</td>
|
| 393 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0.8</td>
|
| 394 |
+
</tr>
|
| 395 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 396 |
+
<td style="padding: 8px 5; color: #94a3b8;">DRY Base</td>
|
| 397 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">1.75</td>
|
| 398 |
+
</tr>
|
| 399 |
+
<tr style="border-bottom: 1px solid #1e293b;">
|
| 400 |
+
<td style="padding: 8px 5; color: #94a3b8;">DRY Allowed Length</td>
|
| 401 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">10</td>
|
| 402 |
+
</tr>
|
| 403 |
+
|
| 404 |
+
<tr>
|
| 405 |
+
<td style="padding: 8px 5; color: #94a3b8;">Optional: Adaptive-P Target</td>
|
| 406 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0.6</td>
|
| 407 |
+
</tr>
|
| 408 |
+
<tr>
|
| 409 |
+
<td style="padding: 8px 5; color: #94a3b8;">Optional: Adaptive-P Decay</td>
|
| 410 |
+
<td style="padding: 8px 5; text-align: right; color: #00f2ff;">0.5</td>
|
| 411 |
+
</tr>
|
| 412 |
+
|
| 413 |
+
</table>
|
| 414 |
+
</div>
|
| 415 |
+
|
| 416 |
+
<div class="crystal-card magenta-card" style="flex: 1; min-width: 250px; margin: 0; border-radius: 12px;">
|
| 417 |
+
<h3 style="color: #ff00ff; margin-top: 0;"> GGUF Quants</h3>
|
| 418 |
+
|
| 419 |
+
| Quant | Size | Download Link |
|
| 420 |
+
| :--- | :--- | :--- |
|
| 421 |
+
| **Q4_K_S** | `17.8 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gembrain-31B-Q4_K_S.gguf) |
|
| 422 |
+
| **Q4_K_M** | `18.7 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gembrain-31B-Q4_K_M.gguf) |
|
| 423 |
+
| **Q5_K_S** | `21.3 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gembrain-31B-Q5_K_S.gguf) |
|
| 424 |
+
| **Q5_K_M** | `21.8 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gembrain-31B-Q5_K_M.gguf) |
|
| 425 |
+
| **Q6_K** | `25.2 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gembrain-31B-Q6_K.gguf) |
|
| 426 |
+
| **Q8_0** | `32.6 GB` | [Click](https://huggingface.co/Nimbz/Gemma-4-Gembrain-31B-GGUF/blob/main/Gemsicle-31B-Q8_0.gguf) |
|
| 427 |
+
|
| 428 |
+
</ul>
|
| 429 |
+
</div>
|
| 430 |
+
</div>
|
| 431 |
+
|
| 432 |
+
<div class="crystal-card magenta-card">
|
| 433 |
+
<h3 style="color: #ff00ff; margin-top: 0;">🔮 Prompt Format</h3>
|
| 434 |
+
|
| 435 |
+
[**Please refer to the original google/gemma-4-31b-it for the correct chat template.**](https://huggingface.co/google/gemma-4-31B-it#2-thinking-mode-configuration)
|
| 436 |
+
|
| 437 |
+
Let your frontend handle the chat template if possible (e.g., Chat Completion in SillyTavern).
|
| 438 |
+
|
| 439 |
+
**For Reasoning:** Add `<|think|>` at the very beginning of the system prompt. Thinking happens between `<|channel>thought\n` and
|
| 440 |
+
`<channel|>` tags.
|
| 441 |
+
|
| 442 |
+
```text
|
| 443 |
+
<|turn>system
|
| 444 |
+
<|think|>
|
| 445 |
+
You are a helpful assistant<turn|>
|
| 446 |
+
<|turn>user
|
| 447 |
+
Hello<turn|>
|
| 448 |
+
<|turn>model
|
| 449 |
+
Hi there<turn|>
|
| 450 |
+
<|turn>user
|
| 451 |
+
How are you?<turn|>
|
| 452 |
+
<|turn>model
|
| 453 |
+
```
|
| 454 |
+
</div>
|
| 455 |
+
|
| 456 |
+
<h2 style="color: #e2e8f0; border-bottom: 1px solid #334155; padding-bottom: 5px; margin-top: 30px;">🧪 Merge Details</h2>
|
| 457 |
+
<p style="font-size: 0.9rem; color: #94a3b8;">This model was systematically created through a five-stage process of priming models for their given purpose and merging the results:</p>
|
| 458 |
+
|
| 459 |
+
<div class="phase-grid">
|
| 460 |
+
<div class="phase-box" style="border-color: #00f2ff;">
|
| 461 |
+
<h4 style="color: #00f2ff; margin: 0 0 5px 0;">Phase 01: breadcrumbs_ties</h4>
|
| 462 |
+
<p style="font-size: 0.8rem; margin: 0; color: #cbd5e1;">Gemopus X MeroMero
|
| 463 |
+
<details>
|
| 464 |
+
<summary></summary>
|
| 465 |
+
|
| 466 |
+
```
|
| 467 |
+
models:
|
| 468 |
+
- model: ./G4-MeroMero-31B
|
| 469 |
+
- model: ./G4-Gemopus-4-31B-it
|
| 470 |
+
merge_method: breadcrumbs_ties
|
| 471 |
+
base_model: ./G4-31B-it
|
| 472 |
+
parameters:
|
| 473 |
+
density: 0.85
|
| 474 |
+
weight: 0.5
|
| 475 |
+
int8_mask: true
|
| 476 |
+
dtype: bfloat16
|
| 477 |
+
```
|
| 478 |
+
|
| 479 |
+
</details></p>
|
| 480 |
+
</div>
|
| 481 |
+
<div class="phase-box" style="border-color: #00f2ff;">
|
| 482 |
+
<h4 style="color: #00f2ff; margin: 0 0 5px 0;">Phase 02: slerp</h4>
|
| 483 |
+
<p style="font-size: 0.8rem; margin: 0; color: #cbd5e1;">GarnetV2 X Musica-v1
|
| 484 |
+
<details>
|
| 485 |
+
<summary></summary>
|
| 486 |
+
|
| 487 |
+
```
|
| 488 |
+
models:
|
| 489 |
+
- model: ./G4-Gemma4-GarnetV2-31B
|
| 490 |
+
- model: ./G4-31B-Musica-v1
|
| 491 |
+
merge_method: slerp
|
| 492 |
+
base_model: ./G4-Gemma4-GarnetV2-31B
|
| 493 |
+
parameters:
|
| 494 |
+
t:
|
| 495 |
+
- value: 0.6
|
| 496 |
+
dtype: bfloat16
|
| 497 |
+
```
|
| 498 |
+
|
| 499 |
+
</details></p>
|
| 500 |
+
</div>
|
| 501 |
+
</div>
|
| 502 |
+
|
| 503 |
+
<div class="phase-grid">
|
| 504 |
+
<div class="phase-box" style="border-color: #ff00ff;">
|
| 505 |
+
<h4 style="color: #ff00ff; margin: 0 0 5px 0;">Phase 03: della_linear</h4>
|
| 506 |
+
<p style="font-size: 0.8rem; margin: 0; color: #cbd5e1;">Gemsicle X Gemma-4-31B-it-heretic-ara
|
| 507 |
+
<details>
|
| 508 |
+
<summary></summary>
|
| 509 |
+
|
| 510 |
+
```
|
| 511 |
+
models:
|
| 512 |
+
- model: ./Gemsicle-31B
|
| 513 |
+
parameters:
|
| 514 |
+
weight: 1.0
|
| 515 |
+
- model: ./G4-gemma-4-31b-it-heretic-ara
|
| 516 |
+
parameters:
|
| 517 |
+
weight: 0.75
|
| 518 |
+
density: 0.65
|
| 519 |
+
merge_method: della_linear
|
| 520 |
+
base_model: ./G4-31B-it
|
| 521 |
+
parameters:
|
| 522 |
+
weight: 1.0
|
| 523 |
+
normalize: false
|
| 524 |
+
epsilon: 0.05
|
| 525 |
+
lambda: 1.0
|
| 526 |
+
dtype: bfloat16
|
| 527 |
+
```
|
| 528 |
+
|
| 529 |
+
</details></p>
|
| 530 |
+
</div>
|
| 531 |
+
<div class="phase-box" style="border-color: #ff00ff; flex-grow: 1;">
|
| 532 |
+
<h4 style="color: #ff00ff; margin: 0 0 5px 0;">Phase 04: model_stock</h4>
|
| 533 |
+
<p style="font-size: 0.8rem; margin: 0; color: #cbd5e1;">Phase 01 X Phase 02 X Phase 03
|
| 534 |
+
<details>
|
| 535 |
+
<summary></summary>
|
| 536 |
+
|
| 537 |
+
```
|
| 538 |
+
models:
|
| 539 |
+
- model: ./phase01_breadcrumbs_ties
|
| 540 |
+
- model: ./phase02_slerp
|
| 541 |
+
merge_method: model_stock
|
| 542 |
+
base_model: ./phase03_della_linear
|
| 543 |
+
dtype: bfloat16
|
| 544 |
+
tokenizer_source: "base"
|
| 545 |
+
```
|
| 546 |
+
|
| 547 |
+
</details></p>
|
| 548 |
+
</div>
|
| 549 |
+
|
| 550 |
+
</div>
|
| 551 |
+
|
| 552 |
+
<div class="phase-grid">
|
| 553 |
+
<div class="phase-box" style="border-image: linear-gradient(90deg, #00f2ff, #ff00ff) 1; flex-grow: 1;">
|
| 554 |
+
<h4 style="background: linear-gradient(90deg, #00f2ff, #ff00ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0 0 5px 0;">Phase 05: arcee_fusion</h4>
|
| 555 |
+
<p style="font-size: 0.8rem; margin: 0; color: #cbd5e1;">Gemsicle X Phase 04
|
| 556 |
+
<details>
|
| 557 |
+
<summary></summary>
|
| 558 |
+
|
| 559 |
+
```
|
| 560 |
+
models:
|
| 561 |
+
- model: ./Gemsicle-31B
|
| 562 |
+
- model: ./phase04_model_stock
|
| 563 |
+
merge_method: arcee_fusion
|
| 564 |
+
base_model: ./Gemsicle-31B
|
| 565 |
+
dtype: bfloat16
|
| 566 |
+
tokenizer_source: "base"
|
| 567 |
+
```
|
| 568 |
+
|
| 569 |
+
</details></p>
|
| 570 |
+
</div>
|
| 571 |
+
</div>
|
| 572 |
+
|
| 573 |
+
<div style="display: flex; gap: 20px; flex-wrap: wrap; margin-top: 30px;">
|
| 574 |
+
|
| 575 |
+
<div class="crystal-card gold-card" style="flex: 1; min-width: 250px; margin: 0; border-radius: 12px;">
|
| 576 |
+
|
| 577 |
+
<h3 style="color: #fbbf24; margin-top: 0;">🏆 Credits & Honors</h3>
|
| 578 |
+
|
| 579 |
+
<li style="margin-bottom: 8px;"><b>The Open-Source Community:</b> For providing the brilliant base models and fine-tunes that made this synthesis possible.</li>
|
| 580 |
+
|
| 581 |
+
<li style="margin-bottom: 8px;"><b><a href="https://www.reddit.com/r/BeaverAI/" style="color: #fbbf24; text-decoration: none;">The BeaverAI Community</a>:</b> The people on the BeaverAI Discord - Without your help I wouldn't do all that.</li>
|
| 582 |
+
|
| 583 |
+
<li style="margin-bottom: 8px;"><b>Mergekit:</b> Once again thank you Arcee AI for the great and easy to use mergekit! And thanks to zerofota and their fork for Gemma 4 support.</li>
|
| 584 |
+
|
| 585 |
+
<li style="margin-bottom: 8px;"><b><a href="https://huggingface.co/Ateron" style="color: #fbbf24; text-decoration: none;">Ateron</a>:</b> Big kudos for providing me with the first steps for merging models and your relentless testing and support.</li>
|
| 586 |
+
|
| 587 |
+
<li><b>Google Gemini:</b> For once again helping me to craft this specific model card.</li>
|
| 588 |
+
</div>
|
| 589 |
+
|
| 590 |
+
</div>
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro format_type_argument(type_value) -%}
|
| 2 |
+
{%- if type_value is string -%}
|
| 3 |
+
<|"|>{{ type_value | upper }}<|"|>
|
| 4 |
+
{%- elif type_value is iterable and type_value is not string -%}
|
| 5 |
+
[
|
| 6 |
+
{%- for item in type_value -%}
|
| 7 |
+
<|"|>{{ item | upper }}<|"|>
|
| 8 |
+
{%- if not loop.last %},{% endif -%}
|
| 9 |
+
{%- endfor -%}
|
| 10 |
+
]
|
| 11 |
+
{%- else -%}
|
| 12 |
+
{{- format_argument(type_value) -}}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- endmacro -%}
|
| 15 |
+
|
| 16 |
+
{%- macro format_parameters(properties, required, filter_keys=false) -%}
|
| 17 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 18 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 19 |
+
{%- for key, value in properties | dictsort -%}
|
| 20 |
+
{%- set add_comma = false -%}
|
| 21 |
+
{%- if not filter_keys or key not in standard_keys -%}
|
| 22 |
+
{%- if ns.found_first %},{% endif -%}
|
| 23 |
+
{%- set ns.found_first = true -%}
|
| 24 |
+
{{ key }}:{
|
| 25 |
+
{%- if value['description'] -%}
|
| 26 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 27 |
+
{%- set add_comma = true -%}
|
| 28 |
+
{%- endif -%}
|
| 29 |
+
{%- if value['type'] and ('string' in value['type'] or 'STRING' in value['type']) -%}
|
| 30 |
+
{%- if value['enum'] -%}
|
| 31 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 32 |
+
enum:{{ format_argument(value['enum']) }}
|
| 33 |
+
{%- endif -%}
|
| 34 |
+
{%- elif value['type'] and ('array' in value['type'] or 'ARRAY' in value['type']) -%}
|
| 35 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 36 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 37 |
+
items:{
|
| 38 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 39 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 40 |
+
{%- if item_value is not none -%}
|
| 41 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 42 |
+
{%- set ns_items.found_first = true -%}
|
| 43 |
+
{%- if item_key == 'properties' -%}
|
| 44 |
+
properties:{
|
| 45 |
+
{%- if item_value is mapping -%}
|
| 46 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 47 |
+
{%- endif -%}
|
| 48 |
+
}
|
| 49 |
+
{%- elif item_key == 'required' -%}
|
| 50 |
+
required:[
|
| 51 |
+
{%- for req_item in item_value -%}
|
| 52 |
+
<|"|>{{- req_item -}}<|"|>
|
| 53 |
+
{%- if not loop.last %},{% endif -%}
|
| 54 |
+
{%- endfor -%}
|
| 55 |
+
]
|
| 56 |
+
{%- elif item_key == 'type' -%}
|
| 57 |
+
type:{{ format_type_argument(item_value) }}
|
| 58 |
+
{%- else -%}
|
| 59 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 60 |
+
{%- endif -%}
|
| 61 |
+
{%- endif -%}
|
| 62 |
+
{%- endfor -%}
|
| 63 |
+
}
|
| 64 |
+
{%- endif -%}
|
| 65 |
+
{%- endif -%}
|
| 66 |
+
{%- if value['nullable'] %}
|
| 67 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 68 |
+
nullable:true
|
| 69 |
+
{%- endif -%}
|
| 70 |
+
{%- if value['type'] and ('object' in value['type'] or 'OBJECT' in value['type']) -%}
|
| 71 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 72 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 73 |
+
properties:{
|
| 74 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 75 |
+
}
|
| 76 |
+
{%- elif value is mapping -%}
|
| 77 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 78 |
+
properties:{
|
| 79 |
+
{{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
|
| 80 |
+
}
|
| 81 |
+
{%- endif -%}
|
| 82 |
+
{%- if value['required'] -%}
|
| 83 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 84 |
+
required:[
|
| 85 |
+
{%- for item in value['required'] | default([]) -%}
|
| 86 |
+
<|"|>{{- item -}}<|"|>
|
| 87 |
+
{%- if not loop.last %},{% endif -%}
|
| 88 |
+
{%- endfor -%}
|
| 89 |
+
]
|
| 90 |
+
{%- endif -%}
|
| 91 |
+
{%- endif -%}
|
| 92 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 93 |
+
type:{{ format_type_argument(value['type']) }}}
|
| 94 |
+
{%- endif -%}
|
| 95 |
+
{%- endfor -%}
|
| 96 |
+
{%- endmacro -%}
|
| 97 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 98 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 99 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 100 |
+
{%- if params -%}
|
| 101 |
+
,parameters:{
|
| 102 |
+
{%- if params['properties'] -%}
|
| 103 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- if params['required'] -%}
|
| 106 |
+
required:[
|
| 107 |
+
{%- for item in params['required'] -%}
|
| 108 |
+
<|"|>{{- item -}}<|"|>
|
| 109 |
+
{{- ',' if not loop.last -}}
|
| 110 |
+
{%- endfor -%}
|
| 111 |
+
],
|
| 112 |
+
{%- endif -%}
|
| 113 |
+
{%- if params['type'] -%}
|
| 114 |
+
type:{{- format_type_argument(params['type']) -}}}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
{%- endif -%}
|
| 117 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 118 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 119 |
+
,response:{
|
| 120 |
+
{%- if response_declaration['description'] -%}
|
| 121 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 122 |
+
{%- endif -%}
|
| 123 |
+
{%- if response_declaration['type'] and ('object' in response_declaration['type'] or 'OBJECT' in response_declaration['type']) -%}
|
| 124 |
+
type:{{- format_type_argument(response_declaration['type']) -}}}
|
| 125 |
+
{%- endif -%}
|
| 126 |
+
{%- endif -%}
|
| 127 |
+
}
|
| 128 |
+
{%- endmacro -%}
|
| 129 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 130 |
+
{%- if argument is string -%}
|
| 131 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 132 |
+
{%- elif argument is boolean -%}
|
| 133 |
+
{{- 'true' if argument else 'false' -}}
|
| 134 |
+
{%- elif argument is mapping -%}
|
| 135 |
+
{{- '{' -}}
|
| 136 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 137 |
+
{%- for key, value in argument | dictsort -%}
|
| 138 |
+
{%- if ns.found_first %},{% endif -%}
|
| 139 |
+
{%- set ns.found_first = true -%}
|
| 140 |
+
{%- if escape_keys -%}
|
| 141 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 142 |
+
{%- else -%}
|
| 143 |
+
{{- key -}}
|
| 144 |
+
{%- endif -%}
|
| 145 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 146 |
+
{%- endfor -%}
|
| 147 |
+
{{- '}' -}}
|
| 148 |
+
{%- elif argument is iterable -%}
|
| 149 |
+
{{- '[' -}}
|
| 150 |
+
{%- for item in argument -%}
|
| 151 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 152 |
+
{%- if not loop.last %},{% endif -%}
|
| 153 |
+
{%- endfor -%}
|
| 154 |
+
{{- ']' -}}
|
| 155 |
+
{%- else -%}
|
| 156 |
+
{{- argument -}}
|
| 157 |
+
{%- endif -%}
|
| 158 |
+
{%- endmacro -%}
|
| 159 |
+
{%- macro strip_thinking(text) -%}
|
| 160 |
+
{%- set ns = namespace(result='') -%}
|
| 161 |
+
{%- for part in text.split('<channel|>') -%}
|
| 162 |
+
{%- if '<|channel>' in part -%}
|
| 163 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 164 |
+
{%- else -%}
|
| 165 |
+
{%- set ns.result = ns.result + part -%}
|
| 166 |
+
{%- endif -%}
|
| 167 |
+
{%- endfor -%}
|
| 168 |
+
{{- ns.result | trim -}}
|
| 169 |
+
{%- endmacro -%}
|
| 170 |
+
|
| 171 |
+
{%- macro format_tool_response_block(tool_name, response) -%}
|
| 172 |
+
{{- '<|tool_response>' -}}
|
| 173 |
+
{%- if response is mapping -%}
|
| 174 |
+
{{- 'response:' + tool_name + '{' -}}
|
| 175 |
+
{%- for key, value in response | dictsort -%}
|
| 176 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 177 |
+
{%- if not loop.last %},{% endif -%}
|
| 178 |
+
{%- endfor -%}
|
| 179 |
+
{{- '}' -}}
|
| 180 |
+
{%- else -%}
|
| 181 |
+
{{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
|
| 182 |
+
{%- endif -%}
|
| 183 |
+
{{- '<tool_response|>' -}}
|
| 184 |
+
{%- endmacro -%}
|
| 185 |
+
|
| 186 |
+
{%- set ns = namespace(prev_message_type=None) -%}
|
| 187 |
+
{%- set loop_messages = messages -%}
|
| 188 |
+
{{- bos_token -}}
|
| 189 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 190 |
+
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 191 |
+
{{- '<|turn>system\n' -}}
|
| 192 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 193 |
+
{%- if enable_thinking is defined and enable_thinking -%}
|
| 194 |
+
{{- '<|think|>\n' -}}
|
| 195 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 196 |
+
{%- endif -%}
|
| 197 |
+
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 198 |
+
{%- if messages[0]['content'] is string -%}
|
| 199 |
+
{{- messages[0]['content'] | trim -}}
|
| 200 |
+
{%- elif messages[0]['content'] is iterable -%}
|
| 201 |
+
{%- for item in messages[0]['content'] -%}
|
| 202 |
+
{{- item['text'] | trim + ' '-}}
|
| 203 |
+
{%- endfor -%}
|
| 204 |
+
{%- endif -%}
|
| 205 |
+
{%- set loop_messages = messages[1:] -%}
|
| 206 |
+
{%- endif -%}
|
| 207 |
+
{%- if tools -%}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- '<|tool>' -}}
|
| 210 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 211 |
+
{{- '<tool|>' -}}
|
| 212 |
+
{%- endfor %}
|
| 213 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 214 |
+
{%- endif -%}
|
| 215 |
+
{{- '<turn|>\n' -}}
|
| 216 |
+
{%- endif %}
|
| 217 |
+
|
| 218 |
+
{#- Pre-scan: find last user message index for reasoning guard -#}
|
| 219 |
+
{%- set ns_turn = namespace(last_user_idx=-1) -%}
|
| 220 |
+
{%- for i in range(loop_messages | length) -%}
|
| 221 |
+
{%- if loop_messages[i]['role'] == 'user' -%}
|
| 222 |
+
{%- set ns_turn.last_user_idx = i -%}
|
| 223 |
+
{%- endif -%}
|
| 224 |
+
{%- endfor -%}
|
| 225 |
+
|
| 226 |
+
{#- Loop through messages -#}
|
| 227 |
+
{%- for message in loop_messages -%}
|
| 228 |
+
{%- if message['role'] != 'tool' -%}
|
| 229 |
+
{%- set ns.prev_message_type = None -%}
|
| 230 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 231 |
+
{#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
|
| 232 |
+
{%- set prev_nt = namespace(role=None, found=false) -%}
|
| 233 |
+
{%- if loop.index0 > 0 -%}
|
| 234 |
+
{%- for j in range(loop.index0 - 1, -1, -1) -%}
|
| 235 |
+
{%- if not prev_nt.found -%}
|
| 236 |
+
{%- if loop_messages[j]['role'] != 'tool' -%}
|
| 237 |
+
{%- set prev_nt.role = loop_messages[j]['role'] -%}
|
| 238 |
+
{%- set prev_nt.found = true -%}
|
| 239 |
+
{%- endif -%}
|
| 240 |
+
{%- endif -%}
|
| 241 |
+
{%- endfor -%}
|
| 242 |
+
{%- endif -%}
|
| 243 |
+
{%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
|
| 244 |
+
{%- if not continue_same_model_turn -%}
|
| 245 |
+
{{- '<|turn>' + role + '\n' }}
|
| 246 |
+
{%- endif -%}
|
| 247 |
+
|
| 248 |
+
{#- Render reasoning/reasoning_content as thinking channel -#}
|
| 249 |
+
{%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
|
| 250 |
+
{%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
|
| 251 |
+
{{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
|
| 252 |
+
{%- endif -%}
|
| 253 |
+
|
| 254 |
+
{%- if message['tool_calls'] -%}
|
| 255 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 256 |
+
{%- set function = tool_call['function'] -%}
|
| 257 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 258 |
+
{%- if function['arguments'] is mapping -%}
|
| 259 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 260 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 261 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 262 |
+
{%- set ns_args.found_first = true -%}
|
| 263 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 264 |
+
{%- endfor -%}
|
| 265 |
+
{%- elif function['arguments'] is string -%}
|
| 266 |
+
{{- function['arguments'] -}}
|
| 267 |
+
{%- endif -%}
|
| 268 |
+
{{- '}<tool_call|>' -}}
|
| 269 |
+
{%- endfor -%}
|
| 270 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 271 |
+
{%- endif -%}
|
| 272 |
+
|
| 273 |
+
{%- set ns_tr_out = namespace(flag=false) -%}
|
| 274 |
+
{%- if message.get('tool_responses') -%}
|
| 275 |
+
{#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
|
| 276 |
+
{%- for tool_response in message['tool_responses'] -%}
|
| 277 |
+
{{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
|
| 278 |
+
{%- set ns_tr_out.flag = true -%}
|
| 279 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 280 |
+
{%- endfor -%}
|
| 281 |
+
{%- elif message.get('tool_calls') -%}
|
| 282 |
+
{#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
|
| 283 |
+
{%- set ns_tool_scan = namespace(stopped=false) -%}
|
| 284 |
+
{%- for k in range(loop.index0 + 1, loop_messages | length) -%}
|
| 285 |
+
{%- if ns_tool_scan.stopped -%}
|
| 286 |
+
{%- elif loop_messages[k]['role'] != 'tool' -%}
|
| 287 |
+
{%- set ns_tool_scan.stopped = true -%}
|
| 288 |
+
{%- else -%}
|
| 289 |
+
{%- set follow = loop_messages[k] -%}
|
| 290 |
+
{#- Resolve tool_call_id to function name -#}
|
| 291 |
+
{%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
|
| 292 |
+
{%- for tc in message['tool_calls'] -%}
|
| 293 |
+
{%- if tc.get('id') == follow.get('tool_call_id') -%}
|
| 294 |
+
{%- set ns_tname.name = tc['function']['name'] -%}
|
| 295 |
+
{%- endif -%}
|
| 296 |
+
{%- endfor -%}
|
| 297 |
+
{#- Handle content as string or content-parts array -#}
|
| 298 |
+
{%- set tool_body = follow.get('content') -%}
|
| 299 |
+
{%- if tool_body is string -%}
|
| 300 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 301 |
+
{%- elif tool_body is iterable and tool_body is not string -%}
|
| 302 |
+
{%- set ns_txt = namespace(s='') -%}
|
| 303 |
+
{%- for part in tool_body -%}
|
| 304 |
+
{%- if part.get('type') == 'text' -%}
|
| 305 |
+
{%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
|
| 306 |
+
{%- endif -%}
|
| 307 |
+
{%- endfor -%}
|
| 308 |
+
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 309 |
+
{%- else -%}
|
| 310 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 311 |
+
{%- endif -%}
|
| 312 |
+
{%- set ns_tr_out.flag = true -%}
|
| 313 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 314 |
+
{%- endif -%}
|
| 315 |
+
{%- endfor -%}
|
| 316 |
+
{%- endif -%}
|
| 317 |
+
|
| 318 |
+
{%- set captured_content -%}
|
| 319 |
+
{%- if message['content'] is string -%}
|
| 320 |
+
{%- if role == 'model' -%}
|
| 321 |
+
{{- strip_thinking(message['content']) -}}
|
| 322 |
+
{%- else -%}
|
| 323 |
+
{{- message['content'] | trim -}}
|
| 324 |
+
{%- endif -%}
|
| 325 |
+
{%- elif message['content'] is iterable -%}
|
| 326 |
+
{%- for item in message['content'] -%}
|
| 327 |
+
{%- if item['type'] == 'text' -%}
|
| 328 |
+
{%- if role == 'model' -%}
|
| 329 |
+
{{- strip_thinking(item['text']) -}}
|
| 330 |
+
{%- else -%}
|
| 331 |
+
{{- item['text'] | trim -}}
|
| 332 |
+
{%- endif -%}
|
| 333 |
+
{%- elif item['type'] == 'image' -%}
|
| 334 |
+
{{- '<|image|>' -}}
|
| 335 |
+
{%- set ns.prev_message_type = 'image' -%}
|
| 336 |
+
{%- elif item['type'] == 'audio' -%}
|
| 337 |
+
{{- '<|audio|>' -}}
|
| 338 |
+
{%- set ns.prev_message_type = 'audio' -%}
|
| 339 |
+
{%- elif item['type'] == 'video' -%}
|
| 340 |
+
{{- '<|video|>' -}}
|
| 341 |
+
{%- set ns.prev_message_type = 'video' -%}
|
| 342 |
+
{%- endif -%}
|
| 343 |
+
{%- endfor -%}
|
| 344 |
+
{%- endif -%}
|
| 345 |
+
{%- endset -%}
|
| 346 |
+
|
| 347 |
+
{{- captured_content -}}
|
| 348 |
+
{%- set has_content = captured_content | trim | length > 0 -%}
|
| 349 |
+
|
| 350 |
+
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 351 |
+
{{- '<|tool_response>' -}}
|
| 352 |
+
{%- elif not (ns_tr_out.flag and not has_content) -%}
|
| 353 |
+
{{- '<turn|>\n' -}}
|
| 354 |
+
{%- endif -%}
|
| 355 |
+
{%- endif -%}
|
| 356 |
+
{%- endfor -%}
|
| 357 |
+
|
| 358 |
+
{%- if add_generation_prompt -%}
|
| 359 |
+
{%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
|
| 360 |
+
{{- '<|turn>model\n' -}}
|
| 361 |
+
{%- if not enable_thinking | default(false) -%}
|
| 362 |
+
{{- '<|channel>thought\n<channel|>' -}}
|
| 363 |
+
{%- endif -%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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"audio_config": null,
|
| 6 |
+
"audio_token_id": 258881,
|
| 7 |
+
"boa_token_id": 256000,
|
| 8 |
+
"boi_token_id": 255999,
|
| 9 |
+
"dtype": "bfloat16",
|
| 10 |
+
"eoa_token_id": 258883,
|
| 11 |
+
"eoa_token_index": 258883,
|
| 12 |
+
"eoi_token_id": 258882,
|
| 13 |
+
"eos_token_id": [
|
| 14 |
+
1,
|
| 15 |
+
106
|
| 16 |
+
],
|
| 17 |
+
"image_token_id": 258880,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"model_type": "gemma4",
|
| 20 |
+
"text_config": {
|
| 21 |
+
"attention_bias": false,
|
| 22 |
+
"attention_dropout": 0.0,
|
| 23 |
+
"attention_k_eq_v": true,
|
| 24 |
+
"bos_token_id": 2,
|
| 25 |
+
"dtype": "bfloat16",
|
| 26 |
+
"enable_moe_block": false,
|
| 27 |
+
"eos_token_id": 1,
|
| 28 |
+
"expert_intermediate_size": null,
|
| 29 |
+
"final_logit_softcapping": 30.0,
|
| 30 |
+
"global_head_dim": 512,
|
| 31 |
+
"head_dim": 256,
|
| 32 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 33 |
+
"hidden_size": 5376,
|
| 34 |
+
"hidden_size_per_layer_input": 0,
|
| 35 |
+
"initializer_range": 0.02,
|
| 36 |
+
"intermediate_size": 21504,
|
| 37 |
+
"layer_types": [
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"full_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"full_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"full_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"sliding_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"full_attention",
|
| 74 |
+
"sliding_attention",
|
| 75 |
+
"sliding_attention",
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"sliding_attention",
|
| 78 |
+
"sliding_attention",
|
| 79 |
+
"full_attention",
|
| 80 |
+
"sliding_attention",
|
| 81 |
+
"sliding_attention",
|
| 82 |
+
"sliding_attention",
|
| 83 |
+
"sliding_attention",
|
| 84 |
+
"sliding_attention",
|
| 85 |
+
"full_attention",
|
| 86 |
+
"sliding_attention",
|
| 87 |
+
"sliding_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"sliding_attention",
|
| 90 |
+
"sliding_attention",
|
| 91 |
+
"full_attention",
|
| 92 |
+
"sliding_attention",
|
| 93 |
+
"sliding_attention",
|
| 94 |
+
"sliding_attention",
|
| 95 |
+
"sliding_attention",
|
| 96 |
+
"sliding_attention",
|
| 97 |
+
"full_attention"
|
| 98 |
+
],
|
| 99 |
+
"max_position_embeddings": 262144,
|
| 100 |
+
"model_type": "gemma4_text",
|
| 101 |
+
"moe_intermediate_size": null,
|
| 102 |
+
"num_attention_heads": 32,
|
| 103 |
+
"num_experts": null,
|
| 104 |
+
"num_global_key_value_heads": 4,
|
| 105 |
+
"num_hidden_layers": 60,
|
| 106 |
+
"num_key_value_heads": 16,
|
| 107 |
+
"num_kv_shared_layers": 0,
|
| 108 |
+
"pad_token_id": 0,
|
| 109 |
+
"rms_norm_eps": 1e-06,
|
| 110 |
+
"rope_parameters": {
|
| 111 |
+
"full_attention": {
|
| 112 |
+
"partial_rotary_factor": 0.25,
|
| 113 |
+
"rope_theta": 1000000.0,
|
| 114 |
+
"rope_type": "proportional"
|
| 115 |
+
},
|
| 116 |
+
"sliding_attention": {
|
| 117 |
+
"rope_theta": 10000.0,
|
| 118 |
+
"rope_type": "default"
|
| 119 |
+
}
|
| 120 |
+
},
|
| 121 |
+
"sliding_window": 1024,
|
| 122 |
+
"tie_word_embeddings": true,
|
| 123 |
+
"top_k_experts": null,
|
| 124 |
+
"use_bidirectional_attention": "vision",
|
| 125 |
+
"use_cache": true,
|
| 126 |
+
"use_double_wide_mlp": false,
|
| 127 |
+
"vocab_size": 262144,
|
| 128 |
+
"vocab_size_per_layer_input": 262144
|
| 129 |
+
},
|
| 130 |
+
"tie_word_embeddings": true,
|
| 131 |
+
"transformers_version": "5.8.1",
|
| 132 |
+
"video_token_id": 258884,
|
| 133 |
+
"vision_config": {
|
| 134 |
+
"_name_or_path": "",
|
| 135 |
+
"architectures": null,
|
| 136 |
+
"attention_bias": false,
|
| 137 |
+
"attention_dropout": 0.0,
|
| 138 |
+
"chunk_size_feed_forward": 0,
|
| 139 |
+
"default_output_length": 280,
|
| 140 |
+
"dtype": "bfloat16",
|
| 141 |
+
"global_head_dim": 72,
|
| 142 |
+
"head_dim": 72,
|
| 143 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 144 |
+
"hidden_size": 1152,
|
| 145 |
+
"id2label": {
|
| 146 |
+
"0": "LABEL_0",
|
| 147 |
+
"1": "LABEL_1"
|
| 148 |
+
},
|
| 149 |
+
"initializer_range": 0.02,
|
| 150 |
+
"intermediate_size": 4304,
|
| 151 |
+
"is_encoder_decoder": false,
|
| 152 |
+
"label2id": {
|
| 153 |
+
"LABEL_0": 0,
|
| 154 |
+
"LABEL_1": 1
|
| 155 |
+
},
|
| 156 |
+
"max_position_embeddings": 131072,
|
| 157 |
+
"model_type": "gemma4_vision",
|
| 158 |
+
"num_attention_heads": 16,
|
| 159 |
+
"num_hidden_layers": 27,
|
| 160 |
+
"num_key_value_heads": 16,
|
| 161 |
+
"output_attentions": false,
|
| 162 |
+
"output_hidden_states": false,
|
| 163 |
+
"patch_size": 16,
|
| 164 |
+
"pooling_kernel_size": 3,
|
| 165 |
+
"position_embedding_size": 10240,
|
| 166 |
+
"problem_type": null,
|
| 167 |
+
"return_dict": true,
|
| 168 |
+
"rms_norm_eps": 1e-06,
|
| 169 |
+
"rope_parameters": {
|
| 170 |
+
"rope_theta": 100.0,
|
| 171 |
+
"rope_type": "default"
|
| 172 |
+
},
|
| 173 |
+
"standardize": true,
|
| 174 |
+
"use_clipped_linears": false
|
| 175 |
+
},
|
| 176 |
+
"vision_soft_tokens_per_image": 280,
|
| 177 |
+
"quantization_config": {
|
| 178 |
+
"quant_method": "exl3",
|
| 179 |
+
"version": "0.0.43",
|
| 180 |
+
"bits": 6.0,
|
| 181 |
+
"head_bits": 8,
|
| 182 |
+
"calibration": {
|
| 183 |
+
"rows": 250,
|
| 184 |
+
"cols": 2048
|
| 185 |
+
},
|
| 186 |
+
"out_scales": "always",
|
| 187 |
+
"codebook": "mcg"
|
| 188 |
+
}
|
| 189 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
1,
|
| 6 |
+
106
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 0,
|
| 9 |
+
"transformers_version": "5.8.1",
|
| 10 |
+
"use_cache": true
|
| 11 |
+
}
|
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f116bedb62fd706a279728e88ef881342ad2c88e065f5c57f866063d51371b97
|
| 3 |
+
size 8293738423
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36bda4da45c41a4c59473f88bf48677bf6c7ccf235d73d7fd05657d0ef903ba5
|
| 3 |
+
size 8433799578
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8158031a0ffe660756896dfbc353dec46e5d383e1bc0646be649bc73f066b5b
|
| 3 |
+
size 8074305720
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43d34f8abb432ad9d15ba48ada0b170571095ff38be84f0464b0d3035d0bd4f8
|
| 3 |
+
size 2561358647
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_ms_per_token": 40,
|
| 3 |
+
"audio_seq_length": 750,
|
| 4 |
+
"feature_extractor": {
|
| 5 |
+
"dither": 0.0,
|
| 6 |
+
"feature_extractor_type": "Gemma4AudioFeatureExtractor",
|
| 7 |
+
"feature_size": 128,
|
| 8 |
+
"fft_length": 512,
|
| 9 |
+
"fft_overdrive": false,
|
| 10 |
+
"frame_length": 320,
|
| 11 |
+
"hop_length": 160,
|
| 12 |
+
"input_scale_factor": 1.0,
|
| 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,
|
| 20 |
+
"preemphasis": 0.0,
|
| 21 |
+
"preemphasis_htk_flavor": true,
|
| 22 |
+
"return_attention_mask": true,
|
| 23 |
+
"sampling_rate": 16000
|
| 24 |
+
},
|
| 25 |
+
"image_processor": {
|
| 26 |
+
"do_convert_rgb": true,
|
| 27 |
+
"do_normalize": false,
|
| 28 |
+
"do_rescale": true,
|
| 29 |
+
"do_resize": true,
|
| 30 |
+
"image_mean": [
|
| 31 |
+
0.0,
|
| 32 |
+
0.0,
|
| 33 |
+
0.0
|
| 34 |
+
],
|
| 35 |
+
"image_processor_type": "Gemma4ImageProcessor",
|
| 36 |
+
"image_seq_length": 280,
|
| 37 |
+
"image_std": [
|
| 38 |
+
1.0,
|
| 39 |
+
1.0,
|
| 40 |
+
1.0
|
| 41 |
+
],
|
| 42 |
+
"max_soft_tokens": 280,
|
| 43 |
+
"patch_size": 16,
|
| 44 |
+
"pooling_kernel_size": 3,
|
| 45 |
+
"resample": 3,
|
| 46 |
+
"rescale_factor": 0.00392156862745098
|
| 47 |
+
},
|
| 48 |
+
"image_seq_length": 280,
|
| 49 |
+
"processor_class": "Gemma4Processor",
|
| 50 |
+
"video_processor": {
|
| 51 |
+
"do_convert_rgb": true,
|
| 52 |
+
"do_normalize": true,
|
| 53 |
+
"do_rescale": true,
|
| 54 |
+
"do_resize": true,
|
| 55 |
+
"do_sample_frames": true,
|
| 56 |
+
"image_mean": [
|
| 57 |
+
0.0,
|
| 58 |
+
0.0,
|
| 59 |
+
0.0
|
| 60 |
+
],
|
| 61 |
+
"image_std": [
|
| 62 |
+
1.0,
|
| 63 |
+
1.0,
|
| 64 |
+
1.0
|
| 65 |
+
],
|
| 66 |
+
"max_soft_tokens": 70,
|
| 67 |
+
"num_frames": 32,
|
| 68 |
+
"patch_size": 16,
|
| 69 |
+
"pooling_kernel_size": 3,
|
| 70 |
+
"resample": 3,
|
| 71 |
+
"rescale_factor": 0.00392156862745098,
|
| 72 |
+
"return_metadata": false,
|
| 73 |
+
"video_processor_type": "Gemma4VideoProcessor"
|
| 74 |
+
}
|
| 75 |
+
}
|
quantization_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2619fe11b50dbed06ac443c51d757b354d0b62d64baa514404d4e84e6713519
|
| 3 |
+
size 32169780
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"boa_token": "<|audio>",
|
| 5 |
+
"boi_token": "<|image>",
|
| 6 |
+
"bos_token": "<bos>",
|
| 7 |
+
"eoa_token": "<audio|>",
|
| 8 |
+
"eoc_token": "<channel|>",
|
| 9 |
+
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<eos>",
|
| 11 |
+
"eot_token": "<turn|>",
|
| 12 |
+
"escape_token": "<|\"|>",
|
| 13 |
+
"etc_token": "<tool_call|>",
|
| 14 |
+
"etd_token": "<tool|>",
|
| 15 |
+
"etr_token": "<tool_response|>",
|
| 16 |
+
"extra_special_tokens": [
|
| 17 |
+
"<|video|>"
|
| 18 |
+
],
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
+
"local_files_only": false,
|
| 22 |
+
"mask_token": "<mask>",
|
| 23 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 24 |
+
"model_specific_special_tokens": {
|
| 25 |
+
"audio_token": "<|audio|>",
|
| 26 |
+
"boa_token": "<|audio>",
|
| 27 |
+
"boi_token": "<|image>",
|
| 28 |
+
"eoa_token": "<audio|>",
|
| 29 |
+
"eoc_token": "<channel|>",
|
| 30 |
+
"eoi_token": "<image|>",
|
| 31 |
+
"eot_token": "<turn|>",
|
| 32 |
+
"escape_token": "<|\"|>",
|
| 33 |
+
"etc_token": "<tool_call|>",
|
| 34 |
+
"etd_token": "<tool|>",
|
| 35 |
+
"etr_token": "<tool_response|>",
|
| 36 |
+
"image_token": "<|image|>",
|
| 37 |
+
"soc_token": "<|channel>",
|
| 38 |
+
"sot_token": "<|turn>",
|
| 39 |
+
"stc_token": "<|tool_call>",
|
| 40 |
+
"std_token": "<|tool>",
|
| 41 |
+
"str_token": "<|tool_response>",
|
| 42 |
+
"think_token": "<|think|>"
|
| 43 |
+
},
|
| 44 |
+
"pad_token": "<pad>",
|
| 45 |
+
"padding_side": "left",
|
| 46 |
+
"processor_class": "Gemma4Processor",
|
| 47 |
+
"response_schema": {
|
| 48 |
+
"properties": {
|
| 49 |
+
"content": {
|
| 50 |
+
"type": "string"
|
| 51 |
+
},
|
| 52 |
+
"role": {
|
| 53 |
+
"const": "assistant"
|
| 54 |
+
},
|
| 55 |
+
"thinking": {
|
| 56 |
+
"type": "string"
|
| 57 |
+
},
|
| 58 |
+
"tool_calls": {
|
| 59 |
+
"items": {
|
| 60 |
+
"properties": {
|
| 61 |
+
"function": {
|
| 62 |
+
"properties": {
|
| 63 |
+
"arguments": {
|
| 64 |
+
"additionalProperties": {},
|
| 65 |
+
"type": "object",
|
| 66 |
+
"x-parser": "gemma4-tool-call"
|
| 67 |
+
},
|
| 68 |
+
"name": {
|
| 69 |
+
"type": "string"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"type": "object",
|
| 73 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 74 |
+
},
|
| 75 |
+
"type": {
|
| 76 |
+
"const": "function"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"type": "object"
|
| 80 |
+
},
|
| 81 |
+
"type": "array",
|
| 82 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"type": "object",
|
| 86 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
|
| 87 |
+
},
|
| 88 |
+
"soc_token": "<|channel>",
|
| 89 |
+
"sot_token": "<|turn>",
|
| 90 |
+
"stc_token": "<|tool_call>",
|
| 91 |
+
"std_token": "<|tool>",
|
| 92 |
+
"str_token": "<|tool_response>",
|
| 93 |
+
"think_token": "<|think|>",
|
| 94 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 95 |
+
"unk_token": "<unk>"
|
| 96 |
+
}
|