KookiesXy commited on
Commit
9a5768b
·
verified ·
1 Parent(s): 9863579

Upload Neo50M HF safetensors export

Browse files
README.md CHANGED
@@ -1,3 +1,72 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - llama
9
+ - causal-lm
10
+ - chat
11
+ - tiny-language-model
12
+ - neo50m
13
  ---
14
+
15
+ # Neo50M
16
+
17
+ Neo50M is a tiny decoder-only chat language model trained from scratch. It is designed for toy/local assistant use, educational experiments, lightweight generation, and testing training pipelines.
18
+
19
+ ## Model Details
20
+
21
+ - **Type:** decoder-only causal language model, Llama-compatible architecture
22
+ - **Parameters:** approximately 52.6M
23
+ - **Context length target:** 16k tokens
24
+ - **Training target:** about 15B pretraining tokens plus chat/instruction tuning
25
+ - **Hardware:** 8x NVIDIA RTX 5090 cloud GPUs
26
+ - **Tokenizer:** TinyLlama/Llama-style 32k tokenizer with a Neo50M chat template
27
+
28
+ ## Intended Uses
29
+
30
+ - toy/local assistant experiments
31
+ - educational training and inference demos
32
+ - lightweight generation
33
+ - testing HF, GGUF, ONNX, and distributed training pipelines
34
+
35
+ ## Limitations
36
+
37
+ Neo50M is very small. It is not reliable for factual accuracy, has limited reasoning ability, may hallucinate, and should not be used for safety-critical decisions or high-stakes advice.
38
+
39
+ ## Transformers Usage
40
+
41
+ ```python
42
+ from transformers import AutoModelForCausalLM, AutoTokenizer
43
+
44
+ repo_id = "KookiesXy/Neo50M"
45
+ tokenizer = AutoTokenizer.from_pretrained(repo_id)
46
+ model = AutoModelForCausalLM.from_pretrained(repo_id, device_map="auto")
47
+
48
+ messages = [{"role": "user", "content": "Write a short thank-you note."}]
49
+ inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
50
+ out = model.generate(inputs, max_new_tokens=120, temperature=0.7, top_p=0.9)
51
+ print(tokenizer.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
52
+ ```
53
+
54
+ ## GGUF Usage
55
+
56
+ After downloading a GGUF file:
57
+
58
+ ```bash
59
+ llama-cli -m neo50m-q4_k_m.gguf -p "User: Write a haiku about GPUs.\nAssistant:"
60
+ ```
61
+
62
+ ## ONNX Usage
63
+
64
+ The ONNX export is intended for forward-pass validation and integration experiments. Use ONNX Runtime to load `onnx/model.onnx` and feed integer `input_ids` plus `attention_mask`.
65
+
66
+ ## Dataset Summary
67
+
68
+ The training pipeline streams a configurable mixture of FineWeb-Edu, Cosmopedia, Wikipedia-like text, TinyStories, and a small permissive code component. SFT uses OpenHermes-style, UltraChat-style, Alpaca-style, and small refusal/helpfulness examples when available. Dataset availability can change; the exact configs are included with the upload.
69
+
70
+ ## Eval Results
71
+
72
+ Eval artifacts, when present, are uploaded under `evals/`.
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {% for message in messages %}{% if loop.first and message['role'] != 'system' %}{{ bos_token + 'System: You are Neo50M, a concise and helpful assistant.\n' }}{% endif %}{% if message['role'] == 'system' %}{{ bos_token + 'System: ' + message['content'].strip() + '\n' }}{% elif message['role'] == 'user' %}{{ 'User: ' + message['content'].strip() + '\n' }}{% elif message['role'] == 'assistant' %}{{ 'Assistant: ' + message['content'].strip() + eos_token }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant: ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 512,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1536,
15
+ "max_position_embeddings": 16384,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 8,
19
+ "num_hidden_layers": 12,
20
+ "num_key_value_heads": 2,
21
+ "pad_token_id": 2,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-06,
24
+ "rope_parameters": {
25
+ "rope_theta": 500000.0,
26
+ "rope_type": "default"
27
+ },
28
+ "tie_word_embeddings": true,
29
+ "transformers_version": "5.12.1",
30
+ "use_cache": true,
31
+ "vocab_size": 32000
32
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "do_sample": true,
4
+ "eos_token_id": 2,
5
+ "max_new_tokens": 256,
6
+ "pad_token_id": 2,
7
+ "temperature": 0.7,
8
+ "top_p": 0.9,
9
+ "transformers_version": "5.12.1"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc82614943d98a47f0a93bf0ed3748325ce394162fb06a12a235983c79df1db9
3
+ size 210302864
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 16384,
10
+ "pad_token": "</s>",
11
+ "padding_side": "right",
12
+ "sp_model_kwargs": {},
13
+ "tokenizer_class": "LlamaTokenizer",
14
+ "unk_token": "<unk>",
15
+ "use_default_system_prompt": false
16
+ }
training_metadata.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_val_loss": 2.788245379924774,
3
+ "config": {
4
+ "_config_path": "configs/sft_chat.yaml",
5
+ "run": {
6
+ "data_config": "configs/data_mix.yaml",
7
+ "model_config": "configs/model_neo50m.yaml",
8
+ "name": "neo50m_sft_chat",
9
+ "output_dir": "outputs",
10
+ "seed": 3337
11
+ },
12
+ "training": {
13
+ "beta1": 0.9,
14
+ "beta2": 0.95,
15
+ "curriculum": [
16
+ {
17
+ "seq_len": 4096,
18
+ "tokens": 40000000
19
+ },
20
+ {
21
+ "seq_len": 8192,
22
+ "tokens": 25000000
23
+ },
24
+ {
25
+ "seq_len": 16384,
26
+ "tokens": 15000000
27
+ }
28
+ ],
29
+ "data_mode": "sft",
30
+ "eval_batches": 4,
31
+ "eval_interval_steps": 250,
32
+ "grad_accum": 8,
33
+ "grad_clip": 1.0,
34
+ "keep_last_checkpoints": 2,
35
+ "learning_rate": 8e-05,
36
+ "log_interval_steps": 5,
37
+ "micro_batch_size": 1,
38
+ "min_lr_ratio": 0.1,
39
+ "num_workers": 0,
40
+ "save_interval_steps": 250,
41
+ "seq_len": 4096,
42
+ "stage": "sft_chat",
43
+ "target_tokens": 80000000,
44
+ "warmup_steps": 200,
45
+ "weight_decay": 0.0
46
+ }
47
+ },
48
+ "env": {
49
+ "cuda": "13.0",
50
+ "git_revision": null,
51
+ "gpu_count": 8,
52
+ "gpu_name": "NVIDIA GeForce RTX 5090",
53
+ "python": "3.12.13",
54
+ "torch": "2.12.0+cu130"
55
+ },
56
+ "global_step": 57750,
57
+ "global_tokens": 15628763136,
58
+ "model_config": {
59
+ "architecture": "llama",
60
+ "attention_bias": false,
61
+ "attention_dropout": 0.0,
62
+ "attn_implementation": "sdpa",
63
+ "gradient_checkpointing": false,
64
+ "hidden_size": 512,
65
+ "initializer_range": 0.02,
66
+ "intermediate_size": 1536,
67
+ "max_position_embeddings": 16384,
68
+ "mlp_bias": false,
69
+ "name": "Neo50M",
70
+ "num_attention_heads": 8,
71
+ "num_hidden_layers": 12,
72
+ "num_key_value_heads": 2,
73
+ "rms_norm_eps": 1e-06,
74
+ "rope_theta": 500000.0,
75
+ "tie_word_embeddings": true,
76
+ "tokenizer_id": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
77
+ "torch_dtype": "bfloat16",
78
+ "use_cache": false
79
+ },
80
+ "precision": {
81
+ "fp8_backend": null,
82
+ "reason": "FP8 unavailable; torchao is not installed",
83
+ "requested": "auto",
84
+ "selected": "bf16"
85
+ },
86
+ "stage_id": "sft_chat_0_seq4096",
87
+ "stage_tokens": 25690112,
88
+ "tokenizer": {
89
+ "bos_token_id": 1,
90
+ "chat_template": "{% for message in messages %}{% if loop.first and message['role'] != 'system' %}{{ bos_token + 'System: You are Neo50M, a concise and helpful assistant.\\n' }}{% endif %}{% if message['role'] == 'system' %}{{ bos_token + 'System: ' + message['content'].strip() + '\\n' }}{% elif message['role'] == 'user' %}{{ 'User: ' + message['content'].strip() + '\\n' }}{% elif message['role'] == 'assistant' %}{{ 'Assistant: ' + message['content'].strip() + eos_token }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant: ' }}{% endif %}",
91
+ "eos_token_id": 2,
92
+ "pad_token_id": 2,
93
+ "tokenizer_id": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
94
+ "vocab_size": 32000
95
+ }
96
+ }