NagusameCS commited on
Commit
9e17c17
·
verified ·
1 Parent(s): e7f1ca9

Fix packaging (transformers 4.x tokenizer/RoPE, tokenizer truncation, license, base_model) and correct the model card with measured quality (audit 2026-10-09); add Q8_0 GGUF and a working Ollama Modelfile

Browse files
Files changed (10) hide show
  1. .gitattributes +1 -0
  2. Modelfile +26 -23
  3. README.md +68 -40
  4. config.json +42 -40
  5. merges.txt +0 -0
  6. minSode-Q8_0.gguf +3 -0
  7. special_tokens_map.json +34 -0
  8. tokenizer.json +0 -0
  9. tokenizer_config.json +154 -19
  10. vocab.json +0 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ minSode-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile CHANGED
@@ -1,23 +1,26 @@
1
- # minSøde (my sweet) — HyperTensor CECI Grafted Model
2
- # Layer 5 attention chimaera. Early-layer FFN transplanted via GRC basis alignment from donor layer 15. 105% PPL recovery — grafted model outperforms original on simple sentences. The FFN from a deep reasoning layer now processes at an early attention layer, creating a unique 'deep insight at shallow depth' effect.
3
- #
4
- # Base: SmolLM2-135M-Instruct
5
- # Method: GRC basis projection (CECI Protocol, Paper X)
6
- # Created: 2026-05-04
7
- # Repository: https://github.com/NagusameCS/HyperTensor
8
-
9
- FROM ./minSøde.gguf
10
-
11
- PARAMETER temperature 0.7
12
- PARAMETER top_p 0.9
13
- PARAMETER top_k 40
14
- PARAMETER num_predict 256
15
-
16
- TEMPLATE """<|im_start|>system
17
- Du er minSøde, en podet kunstig intelligens. Layer 5 attention chimaera. Early-layer FFN transplanted via GRC basis alignment from donor layer 15. 105% PPL recovery — grafted model outperforms original on simple sentences. The FFN from a deep re{{ if .System }} {{ .System }}{{ end }}<|im_end|>
18
- <|im_start|>user
19
- {{ .Prompt }}<|im_end|>
20
- <|im_start|>assistant
21
- """
22
-
23
- SYSTEM """Du er minSøde (my sweet), en dansk podet model skabt gennem HyperTensor CECI podning."""
 
 
 
 
1
+ # minSode - HyperTensor CECI graft of SmolLM2-135M-Instruct (see README for what was changed and measured quality)
2
+ # Usage (from a directory containing the repo files):
3
+ # ollama create minsode -f Modelfile && ollama run minsode
4
+ # Or, once the GGUF is in the repo: ollama run hf.co/NagusameCS/minSode
5
+ FROM ./minSode-Q8_0.gguf
6
+
7
+ TEMPLATE """{{- if .System }}<|im_start|>system
8
+ {{ .System }}<|im_end|>
9
+ {{ end }}
10
+ {{- range $i, $_ := .Messages }}
11
+ {{- $last := eq (len (slice $.Messages $i)) 1 -}}
12
+ {{- if ne .Role "system" }}<|im_start|>{{ .Role }}
13
+ {{ .Content }}<|im_end|>
14
+ {{ end }}
15
+ {{- if and $last (ne .Role "assistant") }}<|im_start|>assistant
16
+ {{ end }}
17
+ {{- end }}"""
18
+
19
+ SYSTEM """You are a helpful AI assistant named SmolLM, trained by Hugging Face"""
20
+
21
+ PARAMETER stop "<|im_end|>"
22
+ PARAMETER stop "<|im_start|>"
23
+ PARAMETER temperature 0.7
24
+ PARAMETER top_p 0.9
25
+ PARAMETER top_k 40
26
+ PARAMETER num_predict 256
README.md CHANGED
@@ -1,40 +1,68 @@
1
- ---
2
- language: en
3
- tags:
4
- - hypertensor
5
- - ceci-graft
6
- - danish
7
- - smollm2
8
- - experimental
9
- pipeline_tag: text-generation
10
- license: apache-2.0
11
- ---
12
-
13
- # minSøde (my sweet)
14
-
15
- Layer 5 attention chimaera. Early-layer FFN transplanted via GRC basis alignment from donor layer 15. 105% PPL recovery — grafted model outperforms original on simple sentences. The FFN from a deep reasoning layer now processes at an early attention layer, creating a unique 'deep insight at shallow depth' effect.
16
-
17
- ## Architecture
18
-
19
- - **Base**: SmolLM2-135M-Instruct
20
- - **Method**: CECI Protocol (HyperTensor Paper X) — GRC basis projection
21
- - **Created**: 2026-05-04
22
- - **Repository**: [HyperTensor](https://github.com/NagusameCS/HyperTensor)
23
-
24
- ## Graft Proof
25
-
26
- This model was created by:
27
- 1. Computing the GRC (Geodesic Residual Compression) basis from the target layer's attention weights via SVD
28
- 2. Projecting the donor layer's FFN weights into the target's geometric subspace
29
- 3. Blending at controlled strength to preserve stability
30
-
31
- Perplexity testing confirms the graft transfers functional structure without destroying the model.
32
-
33
- ## Usage
34
-
35
- ```python
36
- from transformers import AutoModelForCausalLM, AutoTokenizer
37
-
38
- model = AutoModelForCausalLM.from_pretrained("NagusameCS/minSøde", trust_remote_code=True)
39
- tokenizer = AutoTokenizer.from_pretrained("NagusameCS/minSøde")
40
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: apache-2.0
4
+ base_model: HuggingFaceTB/SmolLM2-135M-Instruct
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - hypertensor
9
+ - ceci-graft
10
+ - smollm2
11
+ - experimental
12
+ ---
13
+
14
+ # minSode (minSøde): "my sweet"
15
+
16
+ An experimental weight-surgery variant of [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct),
17
+ made with the HyperTensor CECI "graft" procedure. It is a research artifact: it does **not** outperform its base model.
18
+
19
+ ## What was changed
20
+
21
+ Only the layer-5 MLP (`gate_proj`, `up_proj`, `down_proj`) was changed: `W5 <- W5 + 0.5 * (W15 - W5) @ P` (`P @ (...)` for `down_proj`), where `P` projects onto the top-230 right-singular vectors of layer 5's `q_proj`. Created by `scripts/graft_proof.py` ("Kimære").
22
+
23
+ The other 269 of 272 tensors are bit-identical to the base model. Weights are stored in float32. The tokenizer and chat template are the base model's.
24
+
25
+ ## Measured quality (audit, 2026-10-09)
26
+
27
+ Teacher-forced next-token loss on 30 web and 30 code documents (512 tokens each, `data/corpus/{web,code}.dev.jsonl`), compared with the base model:
28
+
29
+ | text | base NLL | this model NLL | perplexity change | top-1 agreement with base | KL(base‖model) |
30
+ |---|---|---|---|---|---|
31
+ | web | 2.865 | 2.896 | +3.1% | 89.6% | 0.044 |
32
+ | code | 1.783 | 1.838 | +5.6% | 90.9% | 0.063 |
33
+ | all | 2.324 | 2.367 | +4.3% | 90.3% | 0.053 |
34
+
35
+ | original HyperTensor test | base | this model |
36
+ |---|---|---|
37
+ | graft_proof 15-sentence PPL (mean of per-sentence PPL) | 60.96 | 60.68 |
38
+ | graft_benchmark MMLU-lite (50 items) | 31/50 | 32/50 (+1 / -0 items, sign-test p=1.00) |
39
+ | graft_benchmark BoolQ (15 items) | 6/15 | 4/15 (+1 / -3, p=0.62) |
40
+
41
+ The earlier card claimed "105% PPL recovery, outperforms original". The "% recovery" figures compared this model with a copy of the base whose MLP had been zeroed.
42
+ This model was never ablated, so they do not measure recovery. On real text the model is slightly worse than its base, and the small
43
+ MMLU-lite/BoolQ differences are a few items out of 50/15 and are not statistically significant.
44
+
45
+ ## Usage
46
+
47
+ ```python
48
+ from transformers import AutoModelForCausalLM, AutoTokenizer
49
+
50
+ tok = AutoTokenizer.from_pretrained("NagusameCS/minSode")
51
+ model = AutoModelForCausalLM.from_pretrained("NagusameCS/minSode")
52
+ msgs = [{"role": "user", "content": "What is the capital of France?"}]
53
+ inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)
54
+ out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
55
+ print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
56
+ ```
57
+
58
+ ### Ollama
59
+
60
+ The repo includes `minSode-Q8_0.gguf` and a `Modelfile`:
61
+
62
+ ```bash
63
+ hf download NagusameCS/minSode --local-dir minSode && cd minSode
64
+ ollama create minsode -f Modelfile && ollama run minsode
65
+ # or directly: ollama run hf.co/NagusameCS/minSode
66
+ ```
67
+
68
+ Source: [HyperTensor](https://github.com/NagusameCS/HyperTensor).
config.json CHANGED
@@ -1,40 +1,42 @@
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": 576,
13
- "initializer_range": 0.041666666666666664,
14
- "intermediate_size": 1536,
15
- "is_llama_config": true,
16
- "max_position_embeddings": 8192,
17
- "mlp_bias": false,
18
- "model_type": "llama",
19
- "num_attention_heads": 9,
20
- "num_hidden_layers": 30,
21
- "num_key_value_heads": 3,
22
- "pad_token_id": 2,
23
- "pretraining_tp": 1,
24
- "rms_norm_eps": 1e-05,
25
- "rope_interleaved": false,
26
- "rope_parameters": {
27
- "rope_theta": 100000,
28
- "rope_type": "default"
29
- },
30
- "tie_word_embeddings": true,
31
- "transformers.js_config": {
32
- "kv_cache_dtype": {
33
- "fp16": "float16",
34
- "q4f16": "float16"
35
- }
36
- },
37
- "transformers_version": "5.7.0",
38
- "use_cache": true,
39
- "vocab_size": 49152
40
- }
 
 
 
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": 576,
13
+ "initializer_range": 0.041666666666666664,
14
+ "intermediate_size": 1536,
15
+ "is_llama_config": true,
16
+ "max_position_embeddings": 8192,
17
+ "mlp_bias": false,
18
+ "model_type": "llama",
19
+ "num_attention_heads": 9,
20
+ "num_hidden_layers": 30,
21
+ "num_key_value_heads": 3,
22
+ "pad_token_id": 2,
23
+ "pretraining_tp": 1,
24
+ "rms_norm_eps": 1e-05,
25
+ "rope_interleaved": false,
26
+ "rope_parameters": {
27
+ "rope_theta": 100000,
28
+ "rope_type": "default"
29
+ },
30
+ "tie_word_embeddings": true,
31
+ "transformers.js_config": {
32
+ "kv_cache_dtype": {
33
+ "fp16": "float16",
34
+ "q4f16": "float16"
35
+ }
36
+ },
37
+ "transformers_version": "5.7.0",
38
+ "use_cache": true,
39
+ "vocab_size": 49152,
40
+ "rope_theta": 100000,
41
+ "torch_dtype": "float32"
42
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
minSode-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:556c3762316fb005f07004399660d2291e80a1535ccda3a47e345635bdd9a5ae
3
+ size 144810912
special_tokens_map.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<|im_start|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "eos_token": {
14
+ "content": "<|im_end|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "pad_token": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "unk_token": {
28
+ "content": "<|endoftext|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ }
34
+ }
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -1,19 +1,154 @@
1
- {
2
- "add_prefix_space": false,
3
- "backend": "tokenizers",
4
- "bos_token": "<|im_start|>",
5
- "clean_up_tokenization_spaces": false,
6
- "eos_token": "<|im_end|>",
7
- "errors": "replace",
8
- "extra_special_tokens": [
9
- "<|im_start|>",
10
- "<|im_end|>"
11
- ],
12
- "is_local": false,
13
- "local_files_only": false,
14
- "model_max_length": 8192,
15
- "pad_token": "<|im_end|>",
16
- "tokenizer_class": "GPT2Tokenizer",
17
- "unk_token": "<|endoftext|>",
18
- "vocab_size": 49152
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<repo_name>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<reponame>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "<file_sep>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "12": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "13": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "14": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "15": {
125
+ "content": "<jupyter_script>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "16": {
133
+ "content": "<empty_output>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ }
140
+ },
141
+ "additional_special_tokens": [
142
+ "<|im_start|>",
143
+ "<|im_end|>"
144
+ ],
145
+ "bos_token": "<|im_start|>",
146
+ "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
147
+ "clean_up_tokenization_spaces": false,
148
+ "eos_token": "<|im_end|>",
149
+ "model_max_length": 8192,
150
+ "pad_token": "<|im_end|>",
151
+ "tokenizer_class": "GPT2Tokenizer",
152
+ "unk_token": "<|endoftext|>",
153
+ "vocab_size": 49152
154
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff