jieying0729 commited on
Commit
3b257df
·
verified ·
1 Parent(s): c4b968f

llm001 L04 Nano: 26M, 20-step test

Browse files
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: cmz1024/olmo3-190m-zh-nano
3
+ license: apache-2.0
4
+ language:
5
+ - zh
6
+ tags:
7
+ - llm001
8
+ - olmo3
9
+ - chinese
10
+ - pretrained
11
+ ---
12
+
13
+ # OLMo3-190M-zh-nano
14
+
15
+ 为零基础 AI 大模型研发训练营(llm001)L04 Nano 模型(26M 参数,20 步测试训练)。
16
+
17
+ ## 模型配置(Full 的等比缩小版)
18
+
19
+ | 参数 | Full (190M) | Nano (26M) |
20
+ |------|-------------|------------|
21
+ | hidden_size | 768 | 192 |
22
+ | num_layers | 12 | 6 |
23
+ | num_heads | 12 | 3 |
24
+ | intermediate_size | 3072 | 768 |
25
+ | vocab_size | 48000 | 48000 |
26
+
27
+ ## 训练配置
28
+
29
+ - 数据:cmz1024/llm101-olmo3-zh-demo-data (500M tokens)
30
+ - 训练:H100, max_steps=20, bs=32×4=128, lr=1e-3, bf16
31
+
32
+ ## 用法
33
+
34
+ ```python
35
+ from transformers import AutoModelForCausalLM, AutoTokenizer
36
+ model = AutoModelForCausalLM.from_pretrained("cmz1024/olmo3-190m-zh-nano")
37
+ tok = AutoTokenizer.from_pretrained("cmz1024/olmo3-190m-zh-nano")
38
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {% for message in messages %}{% if message['role'] == 'system' %}<|im_start|>system
2
+ {{ message['content'] }}<|im_end|>
3
+ {% elif message['role'] == 'user' %}<|im_start|>user
4
+ {{ message['content'] }}<|im_end|>
5
+ {% elif message['role'] == 'assistant' %}{% generation %}<|im_start|>assistant
6
+ {{ message['content'] }}<|im_end|>
7
+ {% endgeneration %}{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
8
+ {% endif %}
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Olmo3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 2,
8
+ "dtype": "float32",
9
+ "eos_token_id": 0,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 192,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 768,
14
+ "layer_types": [
15
+ "sliding_attention",
16
+ "sliding_attention",
17
+ "full_attention",
18
+ "sliding_attention",
19
+ "sliding_attention",
20
+ "full_attention"
21
+ ],
22
+ "max_position_embeddings": 4096,
23
+ "model_type": "olmo3",
24
+ "num_attention_heads": 3,
25
+ "num_hidden_layers": 6,
26
+ "num_key_value_heads": 3,
27
+ "pad_token_id": 1,
28
+ "rms_norm_eps": 1e-06,
29
+ "rope_parameters": {
30
+ "rope_theta": 500000,
31
+ "rope_type": "default"
32
+ },
33
+ "sliding_window": 4096,
34
+ "tie_word_embeddings": false,
35
+ "transformers_version": "5.8.1",
36
+ "use_cache": false,
37
+ "vocab_size": 48000
38
+ }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 2,
4
+ "eos_token_id": [
5
+ 0
6
+ ],
7
+ "output_attentions": false,
8
+ "output_hidden_states": false,
9
+ "pad_token_id": 1,
10
+ "transformers_version": "5.8.1",
11
+ "use_cache": true
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0445ecf19a82ec5bcf3de799d9ebea0eb9fa37a947420cdecdc0b6005ffd9d33
3
+ size 87910488
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|bos|>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "<|endoftext|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_max_length": 4096,
9
+ "pad_token": "<|pad|>",
10
+ "tokenizer_class": "TokenizersBackend",
11
+ "unk_token": "<|unk|>"
12
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b19cb2d9aa53d2b86a2bb70f5b499c22f9d24e23f3e3370915fcb92ab09b6aa
3
+ size 4856