versae commited on
Commit
75ff5cb
·
verified ·
1 Parent(s): 02ef9eb

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ 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
37
+ LICENSE_FAQ.pdf filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB-License
2
+ Version 1.0, June 2026
3
+ https://ai.nb.no/license/
4
+
5
+ This license (henceforth: NB-license) establishes terms and conditions for use
6
+ of Borealis models with the following copyright notice: Borealis Copyright 2026
7
+ Nasjonalbiblioteket.
8
+
9
+ This model is a fine-tuned derivative of Gemma 3, licensed under the Gemma Terms
10
+ of Use. The original model is available from Google at
11
+ https://deepmind.google/models/gemma/gemma-3/. Modifications, fine-tuning, and
12
+ subsequent derivative works are distributed under the NB-license. The original
13
+ Gemma Terms of Use notices, disclaimers, attribution, and use restrictions
14
+ remain fully intact and are provided at https://ai.google.dev/gemma/terms. The
15
+ additional usage restrictions apply only to our derivative work.
16
+
17
+ 1. Definitions.
18
+
19
+ - "License" means the terms and conditions for use, reproduction, and
20
+ Distribution as defined in this document.
21
+
22
+ - "Licensor" means the copyright owner or entity authorized by the copyright
23
+ owner that is granting the License, including the persons or entities that may
24
+ have rights in the Model and/or distributing the Model.
25
+
26
+ - "You" (or "Your") means an individual or Legal Entity exercising permissions
27
+ granted by this License and/or making use of the Model for whichever purpose and
28
+ in any field of use, including usage of the Model in an end-use application -
29
+ e.g. chatbot, translator, image generator.
30
+
31
+ - "Third Parties" means individuals or legal entities that are not under common
32
+ control with Licensor or You.
33
+
34
+ - "Data" means a collection of information and/or content extracted from the
35
+ dataset used with the Model, including to train, pretrain, or otherwise evaluate
36
+ the Model. The Data is not licensed under this License.
37
+
38
+ - "Output" means the results of operating a Model as embodied in informational
39
+ content resulting therefrom.
40
+
41
+ - "Model" means any accompanying machine-learning based assemblies (including
42
+ checkpoints), consisting of learnt weights, parameters (including optimizer
43
+ states), corresponding to the model architecture as embodied in the
44
+ Complementary Material, that have been trained or tuned, in whole or in part on
45
+ the Data, using the Complementary Material.
46
+
47
+ - "Derivatives of the Model" means all modifications to the Model, works based
48
+ on the Model, or any other model which is created or initialized by transfer of
49
+ patterns of the weights, parameters, activations or output of the Model, to the
50
+ other model, in order to cause the other model to perform similarly to the
51
+ Model, including - but not limited to - distillation methods entailing the use
52
+ of intermediate data representations or methods based on the generation of
53
+ synthetic data by the Model for training the other model.
54
+
55
+ - "Complementary Material" means the accompanying source code and scripts used
56
+ to define, run, load, benchmark or evaluate the Model, and used to prepare data
57
+ for training or evaluation, if any. This includes any accompanying
58
+ documentation, tutorials, examples, etc, if any.
59
+
60
+ - "Distribution" means any transmission, reproduction, publication or other
61
+ sharing of the Model or Derivatives of the Model to a third party, including
62
+ providing the Model as a hosted service made available by electronic or other
63
+ remote means - e.g. API-based or web access.
64
+
65
+ - “Use” includes accessing and utilizing a Model or Derivates of a Model, which
66
+ may also include creating content, fine-tuning, updating, running, training,
67
+ evaluating and/or re-parametrizing such Model or Derivates of a Model.
68
+
69
+ - "Contribution" means any work of authorship, including the original version of
70
+ the Model and any modifications or additions to that Model or Derivatives of the
71
+ Model thereof, that is intentionally submitted to Licensor for inclusion in the
72
+ Model.
73
+
74
+ - "Contributor" means Licensor and any individual or Legal Entity on behalf of
75
+ whom a Contribution has been received by Licensor and subsequently incorporated
76
+ within the Model.
77
+
78
+ 2. Grant of License.
79
+
80
+ Subject to the terms and conditions of this License, each Contributor hereby
81
+ grants to You a time-unlimited, worldwide, non-exclusive, no-charge, royalty-
82
+ free license to use, make, have made, reproduce, prepare derivatives of the
83
+ model, publicly display, publicly perform, sublicense, offer to sell, sell,
84
+ import and otherwise transfer or distribute the model and derivatives of the
85
+ model.
86
+
87
+ 3. Redistribution
88
+
89
+ You may reproduce and distribute copies of the model or derivatives of the model
90
+ in any medium, with or without modifications, provided that You meet the
91
+ following conditions: (a) You must give any other recipients of the model or
92
+ derivatives of the model a copy of this License; and (b) You must retain all
93
+ copyright notices in any redistribution of the model or derivatives of the
94
+ model, excluding those notices that do not pertain to any part of a derivative
95
+ of the model; and (c) You must include the use-based restrictions in section 4
96
+ as a condition precedent to effect any type of legal agreement (e.g. a license)
97
+ governing the use and/or distribution of the model or its Derivatives, and give
98
+ such notice to any subsequent Third Party recipients;
99
+
100
+ 4. Use-based Restrictions.
101
+
102
+ You can only use the Model in compliance with the following conditions:
103
+
104
+ (a) You must comply with applicable laws and regulations.
105
+
106
+ (b) You must not use the model to intentionally recreate material from the
107
+ training data, whether protected by intellectual property rights or as personal
108
+ data
109
+
110
+ (c) Neither the name of the National library nor the names of creators or
111
+ publishers of training data may be used to endorse or promote products derived
112
+ from this model without specific prior written permission.
113
+
114
+ (d) You must not use the Model or its outputs, to provide end-user services
115
+ whose primary purpose is to summarize, restate, copy, or otherwise replace
116
+ services for access to the press publications licensed as training data, unless you have a separate agreement with the
117
+ copyright holders. This includes, but is not limited to, services that provide
118
+ users with functional substitutes for access to the original press content.
119
+
120
+ 5. Outputs.
121
+
122
+ Except as set forth herein, Licensor claims no rights in the Output You generate
123
+ with a model. You are accountable for the Output You generate and its subsequent
124
+ uses. No use of the Output may contravene any provision as stated in this
125
+ License, hereunder section 4 on use-based restrictions.
126
+
127
+ 6. Disclaimer of Warranty.
128
+
129
+ Unless required by applicable law or agreed to in writing, Licensor provides the
130
+ Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
131
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
132
+ including, without limitation, any warranties or conditions of TITLE, NON-
133
+ INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
134
+ solely responsible for determining the appropriateness of using or
135
+ redistributing the Work and assume any risks associated with Your exercise of
136
+ permissions under this License. The Licensor makes no representations or
137
+ warranties that the Model or its Output will be free from factual inaccuracies,
138
+ biases, or potential misinterpretation of the underlying training data. You are
139
+ solely responsible for ensuring that any use of the Model adheres to applicable
140
+ legal and ethical standards.
141
+
142
+ 7. Limitation of Liability.
143
+
144
+ In no event and under no legal theory, whether in tort (including negligence),
145
+ contract, or otherwise, unless required by applicable law (such as deliberate
146
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
147
+ liable to You for damages, including any direct, indirect, special, incidental,
148
+ or consequential damages of any character arising as a result of this License or
149
+ out of the use or inability to use the Work (including but not limited to
150
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
151
+ any and all other commercial damages or losses), even if such Contributor has
152
+ been advised of the possibility of such damages.
153
+
154
+ 8. Accepting Warranty or Additional Liability.
155
+
156
+ While redistributing the Work or Derivative Works thereof, You may choose to
157
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
158
+ other liability obligations and/or rights consistent with this License. However,
159
+ in accepting such obligations, You may act only on Your own behalf and on Your
160
+ sole responsibility, not on behalf of any other Contributor, and only if You
161
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
162
+ incurred by, or claims asserted against, such Contributor by reason of your
163
+ accepting any such warranty or additional liability.
164
+
165
+ 9. Term and Termination.
166
+
167
+ The term of this Agreement will commence upon your acceptance of this Agreement
168
+ and will continue in full force and effect until terminated in accordance with
169
+ the terms and conditions herein. Licensor may terminate this Agreement if you
170
+ are in breach of any term or condition of this Agreement. Upon termination of
171
+ this Agreement, you shall cease use of the licensed model. Section 7 shall
172
+ survive the termination of this Agreement. Termination of the agreement does not
173
+ affect your continued rights to use parts of the model the licensed model was
174
+ based on (if warm trained) under its original license.
175
+
176
+ 10. Governing Law and Jurisdiction.
177
+
178
+ This Agreement will be governed and construed under the laws of Norway. The Oslo
179
+ District Court shall have exclusive jurisdiction of any dispute arising out of
180
+ this Agreement.
LICENSE_FAQ.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4a87118b0b0c1e2d5a06b27bb4b56517d4d62b2b74860f77b8ac2d601224840
3
+ size 140945
README.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: nb-license-1.0
4
+ license_link: https://huggingface.co/NbAiLab/borealis2-e2b-preview/blob/main/LICENSE
5
+ datasets:
6
+ - NbAiLab/aurora-sft-2606
7
+ language:
8
+ - no
9
+ - nb
10
+ - nn
11
+ - en
12
+ base_model:
13
+ - NbAiLab/nb-gpt-gemma4-e2b-instruct-aurora-2604-pre
14
+ pipeline_tag: image-text-to-text
15
+ library_name: transformers
16
+ tags:
17
+ - conversational
18
+ - instruct
19
+ - experimental
20
+ ---
21
+
22
+ # Borealis 2 E2B (Preview)
23
+
24
+ Release: September 28th, 2026.
25
+
26
+ ## Model summary
27
+
28
+ **NbAiLab/borealis2-e2b-preview** is a 2B-parameter instruction-tuned preview model intended for early testing and feedback. It is an experiment and should be treated as pre-release quality.
29
+
30
+ The model starts from [NbAiLab/nb-gpt-gemma4-e2b-instruct-aurora-2604-pre](https://huggingface.co/NbAiLab/nb-gpt-gemma4-e2b-instruct-aurora-2604-pre), continued pre-trained on Aurora 2604 data, and then supervised fine-tuned for three epochs on textual instructions from [NbAiLab/aurora-sft-2606](https://huggingface.co/datasets/NbAiLab/aurora-sft-2606). SFT loss is calculated on assistant responses only.
31
+
32
+ ## Training data
33
+
34
+ Continuous pre-training uses `aurora`, a mix of sources both internal and external, including license materials under agreements. Supervised fine-tuning (SFT) uses **NbAiLab/aurora-sft-2606**. Examples use the Gemma 4 chat template; user and system tokens are masked from the training loss.
35
+
36
+ The `aurora` dataset finished building in April 2026 and contained a total of 47B whitespace-separated words with a knowledge cutoff of January 1st 2025.
37
+
38
+ <details>
39
+ <summary>Sources</summary>
40
+
41
+ ### Word counts
42
+
43
+ | Source\\Language | **Total** | nob | nno | dan | swe | eng | fao | isl | sme | non | fin | smn | sma | smj | sms | fkv | sju | other |
44
+ | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
45
+ | **Total** | **47,588,939,435** | **24,310,675,244** | **11,121,117,598** | **4,635,647,954** | **2,466,930,277** | **2,418,581,785** | **1,534,499,832** | **618,403,302** | **136,625,254** | **130,821,960** | **115,529,546** | **26,099,190** | **25,054,850** | **19,392,470** | **11,725,220** | **10,308,610** | **42,900** | **7,483,443** |
46
+ | **hplt-3.0** | **15,020,676,845** | 7,387,980,881 | 1,650,457,860 | 3,406,653,847 | 1,945,721,769 | 241 | 386,912,020 | 161,832,408 | 509,882 | 39,453,060 | 37,167,967 | 633,100 | 46,480 | 152,950 | 15,170 | 3,139,210 | - | - |
47
+ | **fineweb-2** | **14,616,279,115** | 9,586,371,459 | 3,739,975,210 | - | - | 91 | 814,239,570 | 273,740,521 | 52,936,570 | 47,996,140 | 62,367,474 | 11,890,230 | 9,333,600 | 5,615,090 | 6,946,090 | 4,826,690 | 40,380 | - |
48
+ | **nb-newspapers-mbl** | **6,403,459,654** | 3,222,919,898 | 3,179,351,370 | 36,981 | 12,848 | 205,425 | - | 539 | 76,101 | 1,090 | 102 | - | 551,030 | 27,710 | - | 276,560 | - | - |
49
+ | **finepdfs** | **5,885,083,486** | 3,031,393,119 | 1,161,632,350 | 757,427,249 | 416,681,332 | 3,914 | 280,421,310 | 181,277,900 | 16,222,925 | 13,795,380 | 15,306,017 | 2,480,840 | 1,423,800 | 4,614,610 | 2,057,710 | 345,030 | - | - |
50
+ | **maalfrid-crawl** | **994,747,286** | 492,399,964 | 482,117,030 | 565,919 | 39,357 | 9,450,493 | - | - | 5,264,213 | 188,860 | - | - | 2,787,440 | 1,902,390 | - | 31,620 | - | - |
51
+ | **swallow-code-v2** | **848,043,875** | 42,982 | 12,429 | 16,500,328 | 429,047 | 827,993,226 | 2,432 | 10,507 | 424 | - | 76,313 | - | - | - | - | - | - | 2,976,187 |
52
+ | **nb-books-ocr** | **817,147,445** | 220,740,790 | 459,992,080 | 96,760,244 | 448,854 | 1,267,865 | 601,140 | - | 7,256,662 | 29,052,580 | - | - | 714,070 | 313,160 | - | - | - | - |
53
+ | **megamath** | **795,092,965** | 3,201 | 6,419 | 858,060 | 201,115 | 789,418,493 | - | - | 12,292 | - | 86,129 | - | - | - | - | - | - | 4,507,256 |
54
+ | **fineweb-2-hq** | **439,744,102** | 66 | - | 344,871,624 | 94,872,412 | - | - | - | - | - | - | - | - | - | - | - | - | - |
55
+ | **finewiki** | **425,260,298** | 83,273,602 | 210,355,610 | 11,313,266 | 8,520,965 | 97,669,581 | 8,341,750 | 1,526,141 | 206,149 | 45,590 | 525,544 | 3,482,100 | - | - | - | - | - | - |
56
+ | **maalfrid-government** | **382,884,652** | 175,367,608 | 204,521,790 | 158,061 | 1,319 | 602,180 | - | 1,486 | 1,204,748 | - | - | - | 453,730 | 236,870 | - | 336,860 | - | - |
57
+ | **fineweb-edu** | **358,894,808** | - | - | - | - | 358,807,998 | - | - | - | 86,810 | - | - | - | - | - | - | - | - |
58
+ | **fineweb-hq** | **290,431,291** | 1,036 | - | - | 228 | 290,244,437 | - | - | - | 185,590 | - | - | - | - | - | - | - | - |
59
+ | **giellalt** | **112,384,962** | 3,616,964 | 2,479,390 | 20,829 | 1,031 | - | 43,981,610 | 13,800 | 34,305,758 | 16,860 | - | 7,612,920 | 9,744,700 | 6,529,690 | 2,706,250 | 1,352,640 | 2,520 | - |
60
+ | **parlamint** | **69,692,697** | 69,256,627 | 436,070 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
61
+ | **kudos** | **59,909,727** | 31,938,952 | 27,698,540 | - | - | 191,476 | - | - | 80,759 | - | - | - | - | - | - | - | - | - |
62
+ | **project-gutenberg** | **42,718,920** | - | - | - | - | 42,718,920 | - | - | - | - | - | - | - | - | - | - | - | - |
63
+ | **saami-web** | **18,548,893** | - | - | - | - | 122 | - | - | 18,548,771 | - | - | - | - | - | - | - | - | - |
64
+ | **lovdata** | **5,748,677** | 3,702,797 | 2,045,880 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
65
+ | **patents** | **1,132,943** | 1,132,671 | - | 272 | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
66
+ | **nb-digimanus** | **1,056,794** | 532,627 | 35,570 | 481,274 | - | 7,323 | - | - | - | - | - | - | - | - | - | - | - | - |
67
+
68
+
69
+
70
+ ### Before upsampling
71
+
72
+ | Source\\Language | **Total** | nob | dan | swe | eng | nno | isl | fao | fin | sme | non | smn | sma | smj | sms | fkv | sju | other |
73
+ | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
74
+ | **Total** | **35,903,335,353** | **24,310,675,244** | **4,635,647,954** | **2,466,930,277** | **2,418,581,785** | **1,112,128,723** | **618,403,302** | **153,452,172** | **115,529,546** | **42,158,387** | **13,082,196** | **2,609,919** | **2,505,485** | **1,939,247** | **1,172,522** | **1,030,861** | **4,290** | **7,483,443** |
75
+ | **hplt-3.0** | **13,147,596,474** | 7,387,980,881 | 3,406,653,847 | 1,945,721,769 | 241 | 165,045,786 | 161,832,408 | 38,691,202 | 37,167,967 | 158,376 | 3,945,306 | 63,310 | 4,648 | 15,295 | 1,517 | 313,921 | - | - |
76
+ | **fineweb-2** | **10,402,853,593** | 9,586,371,459 | - | - | 91 | 373,997,521 | 273,740,521 | 81,423,957 | 62,367,474 | 16,287,748 | 4,799,614 | 1,189,023 | 933,360 | 561,509 | 694,609 | 482,669 | 4,038 | - |
77
+ | **finepdfs** | **4,553,779,407** | 3,031,393,119 | 757,427,249 | 416,681,332 | 3,914 | 116,163,235 | 181,277,900 | 28,042,131 | 15,306,017 | 5,012,773 | 1,379,538 | 248,084 | 142,380 | 461,461 | 205,771 | 34,503 | - | - |
78
+ | **nb-newspapers-mbl** | **3,541,220,733** | 3,222,919,898 | 36,981 | 12,848 | 205,425 | 317,935,137 | 539 | - | 102 | 24,164 | 109 | - | 55,103 | 2,771 | - | 27,656 | - | - |
79
+ | **swallow-code-v2** | **848,043,875** | 42,982 | 16,500,328 | 429,047 | 827,993,226 | 12,429 | 10,507 | 2,432 | 76,313 | 424 | - | - | - | - | - | - | - | 2,976,187 |
80
+ | **megamath** | **795,092,965** | 3,201 | 858,060 | 201,115 | 789,418,493 | 6,419 | - | - | 86,129 | 12,292 | - | - | - | - | - | - | - | 4,507,256 |
81
+ | **maalfrid-crawl** | **552,781,457** | 492,399,964 | 565,919 | 39,357 | 9,450,493 | 48,211,703 | - | - | - | 1,622,990 | 18,886 | - | 278,744 | 190,239 | - | 3,162 | - | - |
82
+ | **fineweb-2-hq** | **439,744,102** | 66 | 344,871,624 | 94,872,412 | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
83
+ | **nb-books-ocr** | **370,533,410** | 220,740,790 | 96,760,244 | 448,854 | 1,267,865 | 45,999,208 | - | 60,114 | - | 2,248,354 | 2,905,258 | - | 71,407 | 31,316 | - | - | - | - |
84
+ | **fineweb-edu** | **358,816,679** | - | - | - | 358,807,998 | - | - | - | - | - | 8,681 | - | - | - | - | - | - | - |
85
+ | **fineweb-hq** | **290,264,260** | 1,036 | - | 228 | 290,244,437 | - | - | - | - | - | 18,559 | - | - | - | - | - | - | - |
86
+ | **finewiki** | **225,114,542** | 83,273,602 | 11,313,266 | 8,520,965 | 97,669,581 | 21,035,561 | 1,526,141 | 834,175 | 525,544 | 62,938 | 4,559 | 348,210 | - | - | - | - | - | - |
87
+ | **maalfrid-government** | **197,068,531** | 175,367,608 | 158,061 | 1,319 | 602,180 | 20,452,179 | 1,486 | - | - | 382,952 | - | - | 45,373 | 23,687 | - | 33,686 | - | - |
88
+ | **parlamint** | **69,300,234** | 69,256,627 | - | - | - | 43,607 | - | - | - | - | - | - | - | - | - | - | - | - |
89
+ | **project-gutenberg** | **42,718,920** | - | - | - | 42,718,920 | - | - | - | - | - | - | - | - | - | - | - | - | - |
90
+ | **kudos** | **34,922,645** | 31,938,952 | - | - | 191,476 | 2,769,854 | - | - | - | 22,363 | - | - | - | - | - | - | - | - |
91
+ | **giellalt** | **21,681,541** | 3,616,964 | 20,829 | 1,031 | - | 247,939 | 13,800 | 4,398,161 | - | 10,586,259 | 1,686 | 761,292 | 974,470 | 652,969 | 270,625 | 135,264 | 252 | - |
92
+ | **saami-web** | **5,736,876** | - | - | - | 122 | - | - | - | - | 5,736,754 | - | - | - | - | - | - | - | - |
93
+ | **lovdata** | **3,907,385** | 3,702,797 | - | - | - | 204,588 | - | - | - | - | - | - | - | - | - | - | - | - |
94
+ | **patents** | **1,132,943** | 1,132,671 | 272 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
95
+ | **nb-digimanus** | **1,024,781** | 532,627 | 481,274 | - | 7,323 | 3,557 | - | - | - | - | - | - | - | - | - | - | - | - |
96
+
97
+
98
+ </details>
99
+
100
+
101
+ ## ⚠️ Safety / alignment disclaimer (important)
102
+
103
+ This is a preview experiment and has not been completely safety-aligned. The model may produce harmful, biased, or insensitive content, including content that is offensive, unsafe, or inappropriate. Do not use it for safety-critical or high-stakes applications, and add your own safety mitigations if deploying.
104
+
105
+ ## Intended use
106
+
107
+ - Norwegian-centric assistant-style tasks, including drafting, summarization, Q&A, and light reasoning.
108
+ - Assessment of Norwegian writing style and quality.
109
+ - Early evaluation of behaviour, language coverage (Norwegian, Bokmål, Nynorsk, and English), and quality.
110
+
111
+ ## Limitations
112
+
113
+ - Preview quality; outputs may be unstable and may hallucinate.
114
+ - Not safety-aligned; the model may follow harmful instructions or generate problematic content.
115
+ - This release is an early SFT checkpoint, not a final production model.
116
+
117
+ ## Weights & formats
118
+
119
+ ### Transformers (original)
120
+
121
+ - **NbAiLab/borealis2-e2b-preview** (safetensors).
122
+
123
+ ## License
124
+
125
+ The license of this model is an adaptation of the Apache 2.0 license with additional use-based restrictions. In particular, users of the model are required to refrain from intentionally using the model to recreate data the model has been trained on. The license also requires users not to use the model or its output to provide end-user services whose primary purpose is to give access to licensed press publications in the training data.
126
+
127
+ For more information, see the [LICENSE](./LICENSE) and the [License FAQ](./LICENSE_FAQ.pdf).
128
+
129
+ ## Weights
130
+
131
+ This repository contains the Transformers (safetensors) release of **NbAiLab/borealis2-e2b-preview**.
132
+
133
+ Companion formats:
134
+ - GGUF: [NbAiLab/borealis2-e2b-preview-gguf](https://huggingface.co/NbAiLab/borealis2-e2b-preview-gguf)
135
+
136
+ ## Acknowledgements
137
+
138
+ Thanks to the Gemma team at Google and to everyone contributing feedback on this preview.
139
+
140
+ ## Disclaimer
141
+
142
+ These models may have bias and/or any other undesirable distortions. When third parties, deploy or provide systems and/or services to other parties using any of these models (or using systems based on these models) or become users of the models, they should note that it is their responsibility to mitigate the risks arising from their use and, in any event, to comply with applicable regulations, including regulations regarding the use of artificial intelligence. In no event shall the owner of the models (The National Library of Norway) be liable for any results arising from the use made by third parties of these models.
143
+
144
+ ## Contact
145
+
146
+ For feedback, technical concerns, or collaboration inquiries, please contact <a rel="noopener nofollow" href="mailto:ailab@nb.no">ailab@nb.no</a>.
147
+
chat_template.jinja ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#
2
+ Template: Google Gemma 4 Canonical Chat Template
3
+ Author: Google Gemma Engineering Team
4
+ Published: 2026-07-09
5
+ Context: Fixed tool-calling loops, turn closures, and thinking content-ordering.
6
+ #}
7
+ {%- macro format_parameters(properties, required, filter_keys=false) -%}
8
+ {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
9
+ {%- set ns = namespace(found_first=false) -%}
10
+ {%- for key, value in properties | dictsort -%}
11
+ {%- set add_comma = false -%}
12
+ {%- if not filter_keys or key not in standard_keys -%}
13
+ {%- if ns.found_first %},{% endif -%}
14
+ {%- set ns.found_first = true -%}
15
+ {{ key }}:{
16
+ {%- if value['description'] -%}
17
+ description:<|"|>{{ value['description'] }}<|"|>
18
+ {%- set add_comma = true -%}
19
+ {%- endif -%}
20
+ {%- if value['type'] | upper == 'STRING' -%}
21
+ {%- if value['enum'] -%}
22
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
23
+ enum:{{ format_argument(value['enum']) }}
24
+ {%- endif -%}
25
+ {%- elif value['type'] | upper == 'ARRAY' -%}
26
+ {%- if value['items'] is mapping and value['items'] -%}
27
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
28
+ items:{
29
+ {%- set ns_items = namespace(found_first=false) -%}
30
+ {%- for item_key, item_value in value['items'] | dictsort -%}
31
+ {%- if item_value is not none -%}
32
+ {%- if ns_items.found_first %},{% endif -%}
33
+ {%- set ns_items.found_first = true -%}
34
+ {%- if item_key == 'properties' -%}
35
+ properties:{
36
+ {%- if item_value is mapping -%}
37
+ {{- format_parameters(item_value, value['items']['required'] | default([])) -}}
38
+ {%- endif -%}
39
+ }
40
+ {%- elif item_key == 'required' -%}
41
+ required:[
42
+ {%- for req_item in item_value -%}
43
+ <|"|>{{- req_item -}}<|"|>
44
+ {%- if not loop.last %},{% endif -%}
45
+ {%- endfor -%}
46
+ ]
47
+ {%- elif item_key == 'type' -%}
48
+ {%- if item_value is string -%}
49
+ type:{{ format_argument(item_value | upper) }}
50
+ {%- else -%}
51
+ type:{{ format_argument(item_value | map('upper') | list) }}
52
+ {%- endif -%}
53
+ {%- else -%}
54
+ {{ item_key }}:{{ format_argument(item_value) }}
55
+ {%- endif -%}
56
+ {%- endif -%}
57
+ {%- endfor -%}
58
+ }
59
+ {%- endif -%}
60
+ {%- endif -%}
61
+ {%- if value['nullable'] %}
62
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
63
+ nullable:true
64
+ {%- endif -%}
65
+ {%- if value['type'] | upper == 'OBJECT' -%}
66
+ {%- if value['properties'] is defined and value['properties'] is mapping -%}
67
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
68
+ properties:{
69
+ {{- format_parameters(value['properties'], value['required'] | default([])) -}}
70
+ }
71
+ {%- elif value is mapping -%}
72
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
73
+ properties:{
74
+ {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
75
+ }
76
+ {%- endif -%}
77
+ {%- if value['required'] -%}
78
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
79
+ required:[
80
+ {%- for item in value['required'] | default([]) -%}
81
+ <|"|>{{- item -}}<|"|>
82
+ {%- if not loop.last %},{% endif -%}
83
+ {%- endfor -%}
84
+ ]
85
+ {%- endif -%}
86
+ {%- endif -%}
87
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
88
+ type:<|"|>{{ value['type'] | upper }}<|"|>}
89
+ {%- endif -%}
90
+ {%- endfor -%}
91
+ {%- endmacro -%}
92
+ {%- macro format_function_declaration(tool_data) -%}
93
+ declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
94
+ {%- set params = tool_data['function']['parameters'] -%}
95
+ {%- if params -%}
96
+ ,parameters:{
97
+ {%- if params['properties'] -%}
98
+ properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
99
+ {%- endif -%}
100
+ {%- if params['required'] -%}
101
+ required:[
102
+ {%- for item in params['required'] -%}
103
+ <|"|>{{- item -}}<|"|>
104
+ {{- ',' if not loop.last -}}
105
+ {%- endfor -%}
106
+ ],
107
+ {%- endif -%}
108
+ {%- if params['type'] -%}
109
+ type:<|"|>{{- params['type'] | upper -}}<|"|>}
110
+ {%- endif -%}
111
+ {%- endif -%}
112
+ {%- if 'response' in tool_data['function'] -%}
113
+ {%- set response_declaration = tool_data['function']['response'] -%}
114
+ ,response:{
115
+ {%- if response_declaration['description'] -%}
116
+ description:<|"|>{{- response_declaration['description'] -}}<|"|>,
117
+ {%- endif -%}
118
+ {%- if response_declaration['type'] | upper == 'OBJECT' -%}
119
+ type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
120
+ {%- endif -%}
121
+ {%- endif -%}
122
+ }
123
+ {%- endmacro -%}
124
+ {%- macro format_argument(argument, escape_keys=True) -%}
125
+ {%- if argument is none -%}
126
+ {{- 'null' -}}
127
+ {%- elif argument is string -%}
128
+ {{- '<|"|>' + argument + '<|"|>' -}}
129
+ {%- elif argument is boolean -%}
130
+ {{- 'true' if argument else 'false' -}}
131
+ {%- elif argument is mapping -%}
132
+ {{- '{' -}}
133
+ {%- set ns = namespace(found_first=false) -%}
134
+ {%- for key, value in argument | dictsort -%}
135
+ {%- if ns.found_first %},{% endif -%}
136
+ {%- set ns.found_first = true -%}
137
+ {%- if escape_keys -%}
138
+ {{- '<|"|>' + key + '<|"|>' -}}
139
+ {%- else -%}
140
+ {{- key -}}
141
+ {%- endif -%}
142
+ :{{- format_argument(value, escape_keys=escape_keys) -}}
143
+ {%- endfor -%}
144
+ {{- '}' -}}
145
+ {%- elif argument is sequence -%}
146
+ {{- '[' -}}
147
+ {%- for item in argument -%}
148
+ {{- format_argument(item, escape_keys=escape_keys) -}}
149
+ {%- if not loop.last %},{% endif -%}
150
+ {%- endfor -%}
151
+ {{- ']' -}}
152
+ {%- else -%}
153
+ {{- argument -}}
154
+ {%- endif -%}
155
+ {%- endmacro -%}
156
+ {%- macro strip_thinking(text) -%}
157
+ {%- set ns = namespace(result='') -%}
158
+ {%- for part in text.split('<channel|>') -%}
159
+ {%- if '<|channel>' in part -%}
160
+ {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
161
+ {%- else -%}
162
+ {%- set ns.result = ns.result + part -%}
163
+ {%- endif -%}
164
+ {%- endfor -%}
165
+ {{- ns.result | trim -}}
166
+ {%- endmacro -%}
167
+
168
+ {%- macro format_tool_response_block(tool_name, response) -%}
169
+ {{- '<|tool_response>' -}}
170
+ {%- if response is mapping -%}
171
+ {{- 'response:' + tool_name + '{' -}}
172
+ {%- for key, value in response | dictsort -%}
173
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
174
+ {%- if not loop.last %},{% endif -%}
175
+ {%- endfor -%}
176
+ {{- '}' -}}
177
+ {%- else -%}
178
+ {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
179
+ {%- endif -%}
180
+ {{- '<tool_response|>' -}}
181
+ {%- endmacro -%}
182
+
183
+ {#- ===== SETUP ===== -#}
184
+ {%- set ns = namespace(prev_message_type=None, prev_non_tool_role=None) -%}
185
+ {%- set loop_messages = messages -%}
186
+ {%- set enable_thinking = enable_thinking | default(false) -%}
187
+ {%- set preserve_thinking = preserve_thinking | default(false) -%}
188
+ {{- bos_token -}}
189
+ {#- Handle System/Tool Definitions Block -#}
190
+ {%- if enable_thinking or tools or (messages and 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 -%}
194
+ {{- '<|think|>\n' -}}
195
+ {%- set ns.prev_message_type = 'think' -%}
196
+ {%- endif -%}
197
+ {%- if messages and messages[0]['role'] in ['system', 'developer'] -%}
198
+ {%- if messages[0]['content'] is string -%}
199
+ {{- messages[0]['content'] | trim -}}
200
+ {%- elif messages[0]['content'] is sequence -%}
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 using tracked state — O(1) instead of O(n) backward scan -#}
232
+ {%- set continue_same_model_turn = (role == 'model' and ns.prev_non_tool_role == 'assistant') -%}
233
+ {%- if not continue_same_model_turn -%}
234
+ {{- '<|turn>' + role + '\n' }}
235
+ {%- endif -%}
236
+
237
+ {#- Render reasoning/reasoning_content as thinking channel -#}
238
+ {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
239
+ {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or (preserve_thinking and message.get('tool_calls')) -%}
240
+ {%- if thinking_text and thinking_gate -%}
241
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
242
+ {%- endif -%}
243
+
244
+ {%- if message.get('tool_calls') -%}
245
+ {%- for tool_call in message.get('tool_calls') -%}
246
+ {%- set function = tool_call['function'] -%}
247
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
248
+ {%- if function['arguments'] is mapping -%}
249
+ {%- set ns_args = namespace(found_first=false) -%}
250
+ {%- for key, value in function['arguments'] | dictsort -%}
251
+ {%- if ns_args.found_first %},{% endif -%}
252
+ {%- set ns_args.found_first = true -%}
253
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
254
+ {%- endfor -%}
255
+ {%- elif function['arguments'] is none -%}
256
+ {%- else -%}
257
+ {{- raise_exception(
258
+ "chat_template: tool_calls[].function.arguments must be a "
259
+ "JSON object (mapping), not a string. Deserialize arguments "
260
+ "before passing to the template."
261
+ ) -}}
262
+ {%- endif -%}
263
+ {{- '}<tool_call|>' -}}
264
+ {%- endfor -%}
265
+ {%- set ns.prev_message_type = 'tool_call' -%}
266
+ {%- endif -%}
267
+
268
+ {%- set ns_tr_out = namespace(flag=false) -%}
269
+ {%- if message.get('tool_responses') -%}
270
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
271
+ {%- for tool_response in message.get('tool_responses') -%}
272
+ {{- format_tool_response_block(tool_response['name'] | default('unknown', true), tool_response['response']) -}}
273
+ {%- set ns_tr_out.flag = true -%}
274
+ {%- set ns.prev_message_type = 'tool_response' -%}
275
+ {%- endfor -%}
276
+ {%- elif message.get('tool_calls') -%}
277
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
278
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
279
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
280
+ {%- if ns_tool_scan.stopped -%}
281
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
282
+ {%- set ns_tool_scan.stopped = true -%}
283
+ {%- else -%}
284
+ {%- set follow = loop_messages[k] -%}
285
+ {#- Resolve tool_call_id to function name -#}
286
+ {%- set ns_tname = namespace(name=follow.get('name') or 'unknown') -%}
287
+ {%- for tc in message.get('tool_calls') -%}
288
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
289
+ {%- set ns_tname.name = tc['function']['name'] -%}
290
+ {%- endif -%}
291
+ {%- endfor -%}
292
+ {#- Handle content as string or content-parts array -#}
293
+ {%- set tool_body = follow.get('content') -%}
294
+ {%- if tool_body is string -%}
295
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
296
+ {%- elif tool_body is sequence and tool_body is not string -%}
297
+ {%- set ns_txt = namespace(s='') -%}
298
+ {%- for part in tool_body -%}
299
+ {%- if part.get('type') == 'text' -%}
300
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
301
+ {%- endif -%}
302
+ {%- endfor -%}
303
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
304
+ {%- for part in tool_body -%}
305
+ {%- if part.get('type') in ['image', 'image_url'] -%}
306
+ {{- '<|image|>' -}}
307
+ {%- elif part.get('type') in ['audio', 'input_audio'] -%}
308
+ {{- '<|audio|>' -}}
309
+ {%- elif part.get('type') == 'video' -%}
310
+ {{- '<|video|>' -}}
311
+ {%- endif -%}
312
+ {%- endfor -%}
313
+ {%- else -%}
314
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
315
+ {%- endif -%}
316
+ {%- set ns_tr_out.flag = true -%}
317
+ {%- set ns.prev_message_type = 'tool_response' -%}
318
+ {%- endif -%}
319
+ {%- endfor -%}
320
+ {%- endif -%}
321
+
322
+ {%- set captured_content -%}
323
+ {%- if message.get('content') is string -%}
324
+ {%- if role == 'model' -%}
325
+ {{- strip_thinking(message['content']) -}}
326
+ {%- else -%}
327
+ {{- message['content'] | trim -}}
328
+ {%- endif -%}
329
+ {%- elif message.get('content') is sequence -%}
330
+ {%- for item in message['content'] -%}
331
+ {%- if item.get('type') == 'text' -%}
332
+ {%- if role == 'model' -%}
333
+ {{- strip_thinking(item['text']) -}}
334
+ {%- else -%}
335
+ {{- item['text'] | trim -}}
336
+ {%- endif -%}
337
+ {%- elif item.get('type') in ['image', 'image_url'] -%}
338
+ {{- '<|image|>' -}}
339
+ {%- elif item.get('type') in ['audio', 'input_audio'] -%}
340
+ {{- '<|audio|>' -}}
341
+ {%- elif item.get('type') == 'video' -%}
342
+ {{- '<|video|>' -}}
343
+ {%- endif -%}
344
+ {%- endfor -%}
345
+ {%- endif -%}
346
+ {%- endset -%}
347
+
348
+ {{- captured_content -}}
349
+ {%- set has_content = captured_content | trim | length > 0 -%}
350
+
351
+ {#- Forward-scan: find next non-tool message role for continuation detection -#}
352
+ {%- set next_nt = namespace(role=None, found=false) -%}
353
+ {%- for j in range(loop.index0 + 1, loop_messages | length) -%}
354
+ {%- if not next_nt.found -%}
355
+ {%- if loop_messages[j]['role'] != 'tool' -%}
356
+ {%- set next_nt.role = loop_messages[j]['role'] -%}
357
+ {%- set next_nt.found = true -%}
358
+ {%- endif -%}
359
+ {%- endif -%}
360
+ {%- endfor -%}
361
+
362
+ {%- set continues_into_next = (
363
+ role == 'model'
364
+ and next_nt.role == 'assistant'
365
+ and (not message.get('tool_calls') or ns_tr_out.flag)
366
+ ) -%}
367
+
368
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
369
+ {{- '<|tool_response>' -}}
370
+ {%- elif continues_into_next -%}
371
+ {%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
372
+ {{- '<turn|>\n' -}}
373
+ {%- endif -%}
374
+
375
+ {#- Track previous non-tool role for next iteration (avoids O(n) backward scan) -#}
376
+ {%- set ns.prev_non_tool_role = message['role'] -%}
377
+ {%- endif -%}
378
+ {%- endfor -%}
379
+
380
+ {%- if add_generation_prompt -%}
381
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
382
+ {{- '<|turn>model\n' -}}
383
+ {%- elif ns.prev_message_type == 'tool_response' and enable_thinking -%}
384
+ {{- '<|channel>thought\n' -}}
385
+ {%- endif -%}
386
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma4ForConditionalGeneration"
4
+ ],
5
+ "attn_implementation": "sdpa",
6
+ "audio_config": {
7
+ "_name_or_path": "",
8
+ "architectures": null,
9
+ "attention_chunk_size": 12,
10
+ "attention_context_left": 13,
11
+ "attention_context_right": 0,
12
+ "attention_invalid_logits_value": -1000000000.0,
13
+ "attention_logit_cap": 50.0,
14
+ "chunk_size_feed_forward": 0,
15
+ "conv_kernel_size": 5,
16
+ "dtype": "bfloat16",
17
+ "gradient_clipping": 10000000000.0,
18
+ "hidden_act": "silu",
19
+ "hidden_size": 1024,
20
+ "id2label": {
21
+ "0": "LABEL_0",
22
+ "1": "LABEL_1"
23
+ },
24
+ "initializer_range": 0.02,
25
+ "is_encoder_decoder": false,
26
+ "label2id": {
27
+ "LABEL_0": 0,
28
+ "LABEL_1": 1
29
+ },
30
+ "model_type": "gemma4_audio",
31
+ "num_attention_heads": 8,
32
+ "num_hidden_layers": 12,
33
+ "output_attentions": false,
34
+ "output_hidden_states": false,
35
+ "output_proj_dims": 1536,
36
+ "problem_type": null,
37
+ "residual_weight": 0.5,
38
+ "return_dict": true,
39
+ "rms_norm_eps": 1e-06,
40
+ "subsampling_conv_channels": [
41
+ 128,
42
+ 32
43
+ ],
44
+ "use_clipped_linears": true
45
+ },
46
+ "audio_token_id": 258881,
47
+ "boa_token_id": 256000,
48
+ "boi_token_id": 255999,
49
+ "dtype": "bfloat16",
50
+ "eoa_token_id": 258883,
51
+ "eoa_token_index": 258883,
52
+ "eoi_token_id": 258882,
53
+ "eos_token_id": [
54
+ 1,
55
+ 106
56
+ ],
57
+ "image_token_id": 258880,
58
+ "initializer_range": 0.02,
59
+ "model_type": "gemma4",
60
+ "return_dict": false,
61
+ "text_config": {
62
+ "attention_bias": false,
63
+ "attention_dropout": 0.0,
64
+ "attention_k_eq_v": false,
65
+ "attn_implementation": "sdpa",
66
+ "bos_token_id": 2,
67
+ "dtype": "bfloat16",
68
+ "enable_moe_block": false,
69
+ "eos_token_id": 1,
70
+ "expert_intermediate_size": null,
71
+ "final_logit_softcapping": 30.0,
72
+ "global_head_dim": 512,
73
+ "head_dim": 256,
74
+ "hidden_activation": "gelu_pytorch_tanh",
75
+ "hidden_size": 1536,
76
+ "hidden_size_per_layer_input": 256,
77
+ "initializer_range": 0.02,
78
+ "intermediate_size": 6144,
79
+ "layer_types": [
80
+ "sliding_attention",
81
+ "sliding_attention",
82
+ "sliding_attention",
83
+ "sliding_attention",
84
+ "full_attention",
85
+ "sliding_attention",
86
+ "sliding_attention",
87
+ "sliding_attention",
88
+ "sliding_attention",
89
+ "full_attention",
90
+ "sliding_attention",
91
+ "sliding_attention",
92
+ "sliding_attention",
93
+ "sliding_attention",
94
+ "full_attention",
95
+ "sliding_attention",
96
+ "sliding_attention",
97
+ "sliding_attention",
98
+ "sliding_attention",
99
+ "full_attention",
100
+ "sliding_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "sliding_attention",
104
+ "full_attention",
105
+ "sliding_attention",
106
+ "sliding_attention",
107
+ "sliding_attention",
108
+ "sliding_attention",
109
+ "full_attention",
110
+ "sliding_attention",
111
+ "sliding_attention",
112
+ "sliding_attention",
113
+ "sliding_attention",
114
+ "full_attention"
115
+ ],
116
+ "max_position_embeddings": 131072,
117
+ "model_type": "gemma4_text",
118
+ "moe_intermediate_size": null,
119
+ "num_attention_heads": 8,
120
+ "num_experts": null,
121
+ "num_global_key_value_heads": null,
122
+ "num_hidden_layers": 35,
123
+ "num_key_value_heads": 1,
124
+ "num_kv_shared_layers": 20,
125
+ "pad_token_id": 0,
126
+ "return_dict": false,
127
+ "rms_norm_eps": 1e-06,
128
+ "rope_parameters": {
129
+ "full_attention": {
130
+ "partial_rotary_factor": 0.25,
131
+ "rope_theta": 1000000.0,
132
+ "rope_type": "proportional"
133
+ },
134
+ "sliding_attention": {
135
+ "rope_theta": 10000.0,
136
+ "rope_type": "default"
137
+ }
138
+ },
139
+ "sliding_window": 512,
140
+ "tie_word_embeddings": true,
141
+ "top_k_experts": null,
142
+ "use_bidirectional_attention": null,
143
+ "use_cache": false,
144
+ "use_double_wide_mlp": true,
145
+ "vocab_size": 262144,
146
+ "vocab_size_per_layer_input": 262144
147
+ },
148
+ "tie_word_embeddings": true,
149
+ "transformers_version": "5.5.0",
150
+ "use_cache": false,
151
+ "video_token_id": 258884,
152
+ "vision_config": {
153
+ "_name_or_path": "",
154
+ "architectures": null,
155
+ "attention_bias": false,
156
+ "attention_dropout": 0.0,
157
+ "chunk_size_feed_forward": 0,
158
+ "default_output_length": 280,
159
+ "dtype": "bfloat16",
160
+ "global_head_dim": 64,
161
+ "head_dim": 64,
162
+ "hidden_activation": "gelu_pytorch_tanh",
163
+ "hidden_size": 768,
164
+ "id2label": {
165
+ "0": "LABEL_0",
166
+ "1": "LABEL_1"
167
+ },
168
+ "initializer_range": 0.02,
169
+ "intermediate_size": 3072,
170
+ "is_encoder_decoder": false,
171
+ "label2id": {
172
+ "LABEL_0": 0,
173
+ "LABEL_1": 1
174
+ },
175
+ "max_position_embeddings": 131072,
176
+ "model_type": "gemma4_vision",
177
+ "num_attention_heads": 12,
178
+ "num_hidden_layers": 16,
179
+ "num_key_value_heads": 12,
180
+ "output_attentions": false,
181
+ "output_hidden_states": false,
182
+ "patch_size": 16,
183
+ "pooling_kernel_size": 3,
184
+ "position_embedding_size": 10240,
185
+ "problem_type": null,
186
+ "return_dict": true,
187
+ "rms_norm_eps": 1e-06,
188
+ "rope_parameters": {
189
+ "rope_theta": 100.0,
190
+ "rope_type": "default"
191
+ },
192
+ "standardize": false,
193
+ "use_clipped_linears": true
194
+ },
195
+ "vision_soft_tokens_per_image": 280
196
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 1,
6
+ 106,
7
+ 50
8
+ ],
9
+ "pad_token_id": 0,
10
+ "temperature": 1.0,
11
+ "top_k": 64,
12
+ "top_p": 0.95,
13
+ "transformers_version": "5.5.0"
14
+ }
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbdabd45b28201411d42a86863e422289339dd78dfc41d3f16f276739308f612
3
+ size 9962808076
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16050d584bfb5f68367a7073a7bec8168ce23b85c604bcf2443897b9a1a8ba7d
3
+ size 1089119394
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
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
3
+ size 32169626
tokenizer_config.json ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": false,
21
+ "local_files_only": true,
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
+ "response_template": {
89
+ "defaults": {
90
+ "role": "assistant"
91
+ },
92
+ "fields": {
93
+ "content": {
94
+ "close": [
95
+ "<turn|>",
96
+ "<|tool_response>",
97
+ "<eos>"
98
+ ],
99
+ "content": "text"
100
+ },
101
+ "thinking": {
102
+ "close": "<channel|>",
103
+ "content": "text",
104
+ "open": "<|channel>thought\n"
105
+ },
106
+ "tool_calls": {
107
+ "close": "<tool_call|>",
108
+ "content": "json",
109
+ "content_args": {
110
+ "string_delims": [
111
+ [
112
+ "<|\"|>",
113
+ "<|\"|>"
114
+ ]
115
+ ],
116
+ "unquoted_keys": true
117
+ },
118
+ "open_pattern": "<\\|tool_call>call:(?P<name>\\w+)",
119
+ "repeats": true,
120
+ "transform": {
121
+ "function": {
122
+ "arguments": "{content}",
123
+ "name": "{name}"
124
+ },
125
+ "type": "function"
126
+ }
127
+ }
128
+ },
129
+ "start_anchor": [
130
+ "<|turn>model\n",
131
+ "<tool_response|>"
132
+ ]
133
+ },
134
+ "soc_token": "<|channel>",
135
+ "sot_token": "<|turn>",
136
+ "stc_token": "<|tool_call>",
137
+ "std_token": "<|tool>",
138
+ "str_token": "<|tool_response>",
139
+ "think_token": "<|think|>",
140
+ "tokenizer_class": "GemmaTokenizer",
141
+ "unk_token": "<unk>"
142
+ }