CollectionStudio Ill-Ness commited on
Commit
2d03d39
·
0 Parent(s):

Duplicate from Muse-research/Muse2-125M-Base

Browse files

Co-authored-by: Ill Ness <Ill-Ness@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
README.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ library_name: pytorch
6
+ pipeline_tag: text-generation
7
+ pretty_name: Muse2-125M
8
+ tags:
9
+ - text-generation
10
+ - conversational
11
+ - hybrid-attention
12
+ - convolution
13
+ - grouped-query-attention
14
+ - edge
15
+ - on-device
16
+ - structured-output
17
+ - json
18
+ - muse2
19
+ task_categories:
20
+ - text-generation
21
+ - conversational
22
+ size_categories:
23
+ - 100M<n<1B
24
+ ---
25
+
26
+ # Muse2-125M
27
+
28
+ ## Model Information
29
+
30
+ Muse2-125M is the smaller sibling of [Muse2-230M](../Muse2%20230M) — the same from-scratch hybrid convolution/attention architecture, sized for tighter edge budgets. Both the base and instruction-tuned weights are included.
31
+
32
+ **Model Developer:** Muse Research
33
+
34
+ **Model Architecture:** Muse2 is an auto-regressive language model that uses a hybrid convolution/attention architecture implemented from scratch in PyTorch (`Muse2ForCausalLM`, no `transformers` code). The tuned version is aligned with supervised fine-tuning (SFT) with completion-only loss masking. No RLHF or DPO has been applied.
35
+
36
+ | | Params | Input modalities | Output modalities | Context Length | GQA | Shared Embeddings | Knowledge cutoff |
37
+ | :---- | :---- | :---- | :---- | :---- | :---- | :---- | :---- |
38
+ | Muse2-125M (Base) | 125M (122.9M) | English Text | English Text and code | 8k (128k max) | Yes | Yes | Early 2024 |
39
+ | Muse2-125M (Instruct) | 125M (122.9M) | English Text | English Text and code | 8k (128k max) | Yes | Yes | Early 2024 |
40
+
41
+ **Supported Languages:** English. The model also handles source code and mathematical text.
42
+
43
+ **Architecture Details:** 12 blocks interleaving 7 causal depthwise short-convolution blocks (kernel size 3) with 5 full-attention blocks; Grouped-Query Attention (12 query / 6 key-value heads); RoPE with theta 1e6; RMSNorm; parallel merged SwiGLU MLPs (hidden 768, ff 2304); tied input/output embeddings; vocabulary of 65,536 byte-level BPE tokens (pad=0, bos=1, eos=7, ChatML-style control tokens).
44
+
45
+ **Model Release Date:** Aug 25, 2026
46
+
47
+ **Status:** This is a static model. Later versions may be released that improve model capabilities.
48
+
49
+ **License:** Model weights are released under Apache-2.0.
50
+
51
+ ## Intended Use
52
+
53
+ **Intended Use Cases:** Muse2 is intended for research and education: studying compact hybrid architectures, edge/on-device inference, structured log-to-JSON extraction, formatting-disciplined output, and as a base for further fine-tuning. The Instruct version is intended for assistant-like chat in resource-constrained environments where a small footprint matters more than factual reliability.
54
+
55
+ **Out of Scope:** Production deployment without developer-side evaluation and guardrails. Any safety-critical, medical, legal, or factual-reliance use. Use in any manner that violates applicable laws or the upstream dataset licenses. The model has had **no safety alignment, red-teaming, or content filtering** applied.
56
+
57
+ ## How to use
58
+
59
+ This repository uses the from-scratch `muse` package (PyTorch + safetensors only).
60
+
61
+ **Base model** (text completion):
62
+
63
+ ```python
64
+ import torch
65
+ from tokenizers import Tokenizer
66
+ from muse import Muse2ForCausalLM
67
+
68
+ model = Muse2ForCausalLM.from_pretrained("./weights", dtype=torch.float32).eval()
69
+ tk = Tokenizer.from_file("./weights/tokenizer.json")
70
+ ids = [1] + tk.encode("The capital of France is").ids
71
+ out = model.generate(torch.tensor([ids]), max_new_tokens=40,
72
+ do_sample=False, eos_token_id=7)
73
+ print(tk.decode(out[0][len(ids):].tolist(), skip_special_tokens=True))
74
+ ```
75
+
76
+ **Instruct model** (chat):
77
+
78
+ ```python
79
+ import torch
80
+ from tokenizers import Tokenizer
81
+ from muse import Muse2ForCausalLM
82
+ from muse.sft_data import apply_chat_template
83
+
84
+ model = Muse2ForCausalLM.from_pretrained("./Instruct", dtype=torch.float32).eval()
85
+ tk = Tokenizer.from_file("./Instruct/tokenizer.json")
86
+ ids = apply_chat_template(tk, [{"role": "user", "content": "What is 2+2?"}])
87
+ out = model.generate(torch.tensor([ids]), max_new_tokens=80,
88
+ temperature=0.2, top_k=50, eos_token_id=4)
89
+ print(tk.decode(out[0][len(ids):].tolist(), skip_special_tokens=True))
90
+ ```
91
+
92
+ ## Responsibility & Safety
93
+
94
+ Muse2 is a research artifact released without safety fine-tuning, red-teaming, or content classification. It can produce inaccurate, biased, repetitive, or otherwise objectionable output, and it **hallucinates facts readily at this model scale**. Developers are solely responsible for deployment decisions and should add appropriate input/output safeguards for any application, and should not rely on the model for correctness.
95
+
96
+ ## Ethical Considerations and Limitations
97
+
98
+ **Values:** Muse2 is intended to make small-scale, from-scratch language-model development accessible — every component (tokenizer, architecture, inference stack) is open and reproducible.
99
+
100
+ **Testing:** Safety and capability testing to date is limited to qualitative inspection. It does not cover, nor could it cover, all scenarios. Before any deployment, developers should perform testing appropriate to their use case. Upstream dataset licenses and attribution requirements continue to apply to derivative uses.
config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Muse2ForCausalLM"
4
+ ],
5
+ "block__name_mlp": "parallel_mlp_merged",
6
+ "block_auto_adjust_ff_dim": false,
7
+ "block_dim": 768,
8
+ "block_ff_dim": 2304,
9
+ "block_ffn_dim_multiplier": 1.0,
10
+ "block_ffn_te_autocast": false,
11
+ "block_ffn_use_quantized_params": false,
12
+ "block_mlp_init_scale": 1.0,
13
+ "block_multiple_of": 256,
14
+ "block_norm_eps": 1e-05,
15
+ "block_out_init_scale": 1.0,
16
+ "block_sequence_parallel_norm_across_tp": false,
17
+ "block_use_swiglu": true,
18
+ "block_use_xavier_init": true,
19
+ "bos_token_id": 1,
20
+ "conv_L_cache": 3,
21
+ "conv_bias": false,
22
+ "conv_dim": 768,
23
+ "conv_use_xavier_init": true,
24
+ "dtype": "bfloat16",
25
+ "eos_token_id": 7,
26
+ "ffn_te_autocast": false,
27
+ "ffn_use_quantized_params": false,
28
+ "hidden_size": 768,
29
+ "initializer_range": 0.02,
30
+ "intermediate_size": 2304,
31
+ "layer_types": [
32
+ "conv",
33
+ "conv",
34
+ "full_attention",
35
+ "conv",
36
+ "full_attention",
37
+ "conv",
38
+ "full_attention",
39
+ "conv",
40
+ "full_attention",
41
+ "conv",
42
+ "full_attention",
43
+ "conv"
44
+ ],
45
+ "max_position_embeddings": 128000,
46
+ "model_type": "muse2",
47
+ "norm_eps": 1e-05,
48
+ "num_attention_heads": 12,
49
+ "num_heads": 12,
50
+ "num_hidden_layers": 12,
51
+ "num_key_value_heads": 6,
52
+ "pad_token_id": 0,
53
+ "rope_parameters": {
54
+ "rope_theta": 1000000.0,
55
+ "rope_type": "default"
56
+ },
57
+ "sequence_parallel_norm_across_tp": false,
58
+ "tie_embedding": true,
59
+ "tie_word_embeddings": true,
60
+ "transformers_version": "5.2.0",
61
+ "use_cache": true,
62
+ "use_pos_enc": true,
63
+ "vocab_size": 65536
64
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "do_sample": true,
4
+ "eos_token_id": 7,
5
+ "pad_token_id": 0,
6
+ "temperature": 0.8,
7
+ "top_k": 50,
8
+ "top_p": 0.95,
9
+ "transformers_version": "5.2.0"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cef0cdcd40989ca0e496b9ad8bde9639e927b3d3ca7fd200f24e81ffc4fe77a
3
+ size 245840496
special_tokens_map.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|bos|>": "<|bos|>",
3
+ "<|eos|>": "<|eos|>",
4
+ "<|im_end|>": "<|im_end|>",
5
+ "<|im_start|>": "<|im_start|>",
6
+ "<|pad|>": "<|pad|>",
7
+ "<|system|>": "<|system|>",
8
+ "<|unk|>": "<|unk|>",
9
+ "<|user|>": "<|user|>"
10
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "bos_token": "<|bos|>",
5
+ "bos_token_id": 1,
6
+ "chat_template": "{% for message in messages %}{{ '<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\\n' }}{% endif %}",
7
+ "eos_token": "<|eos|>",
8
+ "eos_token_id": 7,
9
+ "model_max_length": 128000,
10
+ "pad_token": "<|pad|>",
11
+ "pad_token_id": 0,
12
+ "unk_token": "<|unk|>",
13
+ "vocab_size": 65536
14
+ }