初始化项目,由ModelHub XC社区提供模型
Model: NbAiLab/borealis-270m-instruct-preview Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
81
README.md
Normal file
81
README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
license: gemma
|
||||
datasets:
|
||||
- NbAiLab/aurora-sft-2512-filtered
|
||||
language:
|
||||
- 'no'
|
||||
- nb
|
||||
- nn
|
||||
base_model:
|
||||
- google/gemma-3-270m-it
|
||||
pipeline_tag: text-generation
|
||||
library_name: transformers
|
||||
tags:
|
||||
- conversational
|
||||
- instruct
|
||||
- experimental
|
||||
---
|
||||
|
||||
# Borealis 270M Instruct (Preview)
|
||||
|
||||
Release: Jan 31st, 2026.
|
||||
|
||||
## Model summary
|
||||
**NbAiLab/borealis-270m-instruct-preview** is a **270M-parameter** instruction-tuned **preview** model intended for early testing and feedback. It is an **experiment** and should be treated as pre-release quality.
|
||||
|
||||
This model is based on [**google/gemma-3-270m-it**](https://huggingface.co/google/gemma-3-270m-it), and fine-tuned on textual instructions only.
|
||||
|
||||
| Size | Transformers | GGUF (quants: `q8_0`, `f16`, `bf16`) | MLX |
|
||||
|---:|---|---|---|
|
||||
| 270M | [NbAiLab/borealis-270m-instruct-preview](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview) | [NbAiLab/borealis-270m-instruct-preview-gguf](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-gguf) | [NbAiLab/borealis-270m-instruct-preview-mlx](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-mlx) (32-bit)<br>[NbAiLab/borealis-270m-instruct-preview-mlx-8bits](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-mlx-8bits) (8-bit) |
|
||||
| 1B | [NbAiLab/borealis-1b-instruct-preview](https://huggingface.co/NbAiLab/borealis-1b-instruct-preview) | [NbAiLab/borealis-1b-instruct-preview-gguf](https://huggingface.co/NbAiLab/borealis-1b-instruct-preview-gguf) | [NbAiLab/borealis-1b-instruct-preview-mlx](https://huggingface.co/NbAiLab/borealis-1b-instruct-preview-mlx) (32-bit)<br>[NbAiLab/borealis-1b-instruct-preview-mlx-8bits](https://huggingface.co/NbAiLab/borealis-1b-instruct-preview-mlx-8bits) (8-bit) |
|
||||
| 4B | [NbAiLab/borealis-4b-instruct-preview](https://huggingface.co/NbAiLab/borealis-4b-instruct-preview) | [NbAiLab/borealis-4b-instruct-preview-gguf](https://huggingface.co/NbAiLab/borealis-4b-instruct-preview-gguf) | [NbAiLab/borealis-4b-instruct-preview-mlx](https://huggingface.co/NbAiLab/borealis-4b-instruct-preview-mlx) (32-bit)<br>[NbAiLab/borealis-4b-instruct-preview-mlx-8bits](https://huggingface.co/NbAiLab/borealis-4b-instruct-preview-mlx-8bits) (8-bit) |
|
||||
| 12B | [NbAiLab/borealis-12b-instruct-preview](https://huggingface.co/NbAiLab/borealis-12b-instruct-preview) | [NbAiLab/borealis-12b-instruct-preview-gguf](https://huggingface.co/NbAiLab/borealis-12b-instruct-preview-gguf) | [NbAiLab/borealis-12b-instruct-preview-mlx](https://huggingface.co/NbAiLab/borealis-12b-instruct-preview-mlx) (32-bit)<br>[NbAiLab/borealis-12b-instruct-preview-mlx-8bits](https://huggingface.co/NbAiLab/borealis-12b-instruct-preview-mlx-8bits) (8-bit) |
|
||||
| 27B | [NbAiLab/borealis-27b-instruct-preview](https://huggingface.co/NbAiLab/borealis-27b-instruct-preview) | [NbAiLab/borealis-27b-instruct-preview-gguf](https://huggingface.co/NbAiLab/borealis-27b-instruct-preview-gguf) | [NbAiLab/borealis-27b-instruct-preview-mlx](https://huggingface.co/NbAiLab/borealis-27b-instruct-preview-mlx) (32-bit)<br>[NbAiLab/borealis-27b-instruct-preview-mlx-8bits](https://huggingface.co/NbAiLab/borealis-27b-instruct-preview-mlx-8bits) (8-bit) |
|
||||
|
||||
|
||||
## Training data
|
||||
Supervised fine-tuning (SFT) uses **NbAiLab/aurora-sft-2512** (not released yet).
|
||||
|
||||
## ⚠️ Safety / alignment disclaimer (important)
|
||||
This is a **preview experiment** and **has not been safety-aligned yet**. The model may produce **harmful, biased, or insensitive** outputs (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.
|
||||
|
||||
## Intended use
|
||||
- Norwegian-centric assistant-style tasks (e.g., drafting, summarization, Q&A, light reasoning).
|
||||
- Assesstment of Norwegian writing style and quality.
|
||||
- Early evaluation of behavior, language coverage (Norwegian / Bokmål / Nynorsk), and quality.
|
||||
|
||||
## Limitations
|
||||
- Preview quality; outputs may be unstable and may hallucinate.
|
||||
- Not aligned for safety; may follow harmful instructions or generate problematic content (see disclaimer above).
|
||||
|
||||
## Weights & formats
|
||||
|
||||
### Transformers (original)
|
||||
- **NbAiLab/borealis-270m-instruct-preview** (safetensors).
|
||||
|
||||
### GGUF quantizations
|
||||
Available in [**NbAiLab/borealis-270m-instruct-preview-gguf**](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-gguf):
|
||||
- `model-q8_0.gguf`
|
||||
- `model-f16.gguf`
|
||||
- `model-bf16.gguf`
|
||||
|
||||
Use:
|
||||
```bash
|
||||
ollama run hf.co/NbAiLab/borealis-270m-instruct-preview-gguf:BF16
|
||||
```
|
||||
|
||||
### MLX (Apple Silicon)
|
||||
Available in [**NbAiLab/borealis-270m-instruct-preview-mlx**](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-mlx) and quantized to [8 bits](https://huggingface.co/NbAiLab/borealis-270m-instruct-preview-mlx-8bits).
|
||||
|
||||
Use:
|
||||
```bash
|
||||
# Install MLX LM
|
||||
uv tool install mlx-lm
|
||||
|
||||
# Interactive chat REPL
|
||||
mlx_lm.chat --model "NbAiLab/borealis-270m-instruct-preview-mlx"
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
Thanks to the **Gemma** team at Google for releasing Gemma 3 and to everyone contributing feedback on this preview.
|
||||
3
added_tokens.json
Normal file
3
added_tokens.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"<image_soft_token>": 262144
|
||||
}
|
||||
47
chat_template.jinja
Normal file
47
chat_template.jinja
Normal file
@@ -0,0 +1,47 @@
|
||||
{{ bos_token }}
|
||||
{%- if messages[0]['role'] == 'system' -%}
|
||||
{%- if messages[0]['content'] is string -%}
|
||||
{%- set first_user_prefix = messages[0]['content'] + '
|
||||
|
||||
' -%}
|
||||
{%- else -%}
|
||||
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
|
||||
|
||||
' -%}
|
||||
{%- endif -%}
|
||||
{%- set loop_messages = messages[1:] -%}
|
||||
{%- else -%}
|
||||
{%- set first_user_prefix = "" -%}
|
||||
{%- set loop_messages = messages -%}
|
||||
{%- endif -%}
|
||||
{%- for message in loop_messages -%}
|
||||
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
||||
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
||||
{%- endif -%}
|
||||
{%- if (message['role'] == 'assistant') -%}
|
||||
{%- set role = "model" -%}
|
||||
{%- else -%}
|
||||
{%- set role = message['role'] -%}
|
||||
{%- endif -%}
|
||||
{{ '<start_of_turn>' + role + '
|
||||
' + (first_user_prefix if loop.first else "") }}
|
||||
{%- if message['content'] is string -%}
|
||||
{{ message['content'] | trim }}
|
||||
{%- elif message['content'] is iterable -%}
|
||||
{%- for item in message['content'] -%}
|
||||
{%- if item['type'] == 'image' -%}
|
||||
{{ '<start_of_image>' }}
|
||||
{%- elif item['type'] == 'text' -%}
|
||||
{{ item['text'] | trim }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- else -%}
|
||||
{{ raise_exception("Invalid content type") }}
|
||||
{%- endif -%}
|
||||
{{ '<end_of_turn>
|
||||
' }}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{'<start_of_turn>model
|
||||
'}}
|
||||
{%- endif -%}
|
||||
54
config.json
Normal file
54
config.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"_sliding_window_pattern": 6,
|
||||
"architectures": [
|
||||
"Gemma3ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"attn_logit_softcapping": null,
|
||||
"bos_token_id": 2,
|
||||
"dtype": "float32",
|
||||
"eos_token_id": 106,
|
||||
"final_logit_softcapping": null,
|
||||
"head_dim": 256,
|
||||
"hidden_activation": "gelu_pytorch_tanh",
|
||||
"hidden_size": 640,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 2048,
|
||||
"layer_types": [
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"max_position_embeddings": 32768,
|
||||
"model_type": "gemma3_text",
|
||||
"num_attention_heads": 4,
|
||||
"num_hidden_layers": 18,
|
||||
"num_key_value_heads": 1,
|
||||
"pad_token_id": 0,
|
||||
"query_pre_attn_scalar": 256,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_local_base_freq": 10000.0,
|
||||
"rope_scaling": null,
|
||||
"rope_theta": 1000000.0,
|
||||
"sliding_window": 512,
|
||||
"transformers_version": "4.57.1",
|
||||
"use_bidirectional_attention": false,
|
||||
"use_cache": false,
|
||||
"vocab_size": 262144
|
||||
}
|
||||
14
generation_config.json
Normal file
14
generation_config.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"bos_token_id": 2,
|
||||
"cache_implementation": "hybrid",
|
||||
"do_sample": true,
|
||||
"eos_token_id": [
|
||||
106,
|
||||
1,
|
||||
106
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"top_k": 64,
|
||||
"top_p": 0.95,
|
||||
"transformers_version": "4.57.1"
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8eabd69c01d932fe65dfd6c46964f2e4ec10f73a1fbdc296ab6b3e58fe4c6003
|
||||
size 1072419256
|
||||
33
special_tokens_map.json
Normal file
33
special_tokens_map.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"boi_token": "<start_of_image>",
|
||||
"bos_token": {
|
||||
"content": "<bos>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eoi_token": "<end_of_image>",
|
||||
"eos_token": {
|
||||
"content": "<end_of_turn>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"image_token": "<image_soft_token>",
|
||||
"pad_token": {
|
||||
"content": "<pad>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"unk_token": {
|
||||
"content": "<unk>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
|
||||
size 33384568
|
||||
3
tokenizer.model
Normal file
3
tokenizer.model
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
|
||||
size 4689074
|
||||
51346
tokenizer_config.json
Normal file
51346
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user