Image-Text-to-Text
Transformers
Safetensors
gemma4
conversational
instruct
experimental
🇪🇺 Region: EU
Instructions to use NbAiLab/borealis2-26b-a4b-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLab/borealis2-26b-a4b-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NbAiLab/borealis2-26b-a4b-preview") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NbAiLab/borealis2-26b-a4b-preview") model = AutoModelForMultimodalLM.from_pretrained("NbAiLab/borealis2-26b-a4b-preview", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NbAiLab/borealis2-26b-a4b-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NbAiLab/borealis2-26b-a4b-preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NbAiLab/borealis2-26b-a4b-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/NbAiLab/borealis2-26b-a4b-preview
- SGLang
How to use NbAiLab/borealis2-26b-a4b-preview with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NbAiLab/borealis2-26b-a4b-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NbAiLab/borealis2-26b-a4b-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NbAiLab/borealis2-26b-a4b-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NbAiLab/borealis2-26b-a4b-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use NbAiLab/borealis2-26b-a4b-preview with Docker Model Runner:
docker model run hf.co/NbAiLab/borealis2-26b-a4b-preview
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,7 +31,72 @@ The model starts from [google/gemma-4-26B-A4B-it](https://huggingface.co/google/
|
|
| 31 |
|
| 32 |
## Training data
|
| 33 |
|
| 34 |
-
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 |
## ⚠️ Safety / alignment disclaimer (important)
|
| 37 |
|
|
|
|
| 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 Januar 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 |
|