NagusameCS commited on
Commit
20adf38
·
verified ·
1 Parent(s): 9db2a4a

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. minKaereste-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
+ minKaereste-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile CHANGED
@@ -1,23 +1,26 @@
1
- # minKæreste (my dearest) — HyperTensor CECI Grafted Model
2
- # Layer 8 mixed-region crossover. FFN transplanted from layer 18. 122% PPL recovery — the strongest graft in the series. PPL drops from 83 (ablated) to 56 (grafted), recovering past the original 61 baseline. The crossed processing pathway creates emergent behavior neither parent layer exhibits alone.
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 ./minKæreste.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 minKæreste, en podet kunstig intelligens. Layer 8 mixed-region crossover. FFN transplanted from layer 18. 122% PPL recovery — the strongest graft in the series. PPL drops from 83 (ablated) to 56 (grafted), recovering past the original 61 base{{ if .System }} {{ .System }}{{ end }}<|im_end|>
18
- <|im_start|>user
19
- {{ .Prompt }}<|im_end|>
20
- <|im_start|>assistant
21
- """
22
-
23
- SYSTEM """Du er minKæreste (my dearest), en dansk podet model skabt gennem HyperTensor CECI podning."""
 
 
 
 
1
+ # minKaereste - 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 minkaereste -f Modelfile && ollama run minkaereste
4
+ # Or, once the GGUF is in the repo: ollama run hf.co/NagusameCS/minKaereste
5
+ FROM ./minKaereste-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
- # minKæreste (my dearest)
14
-
15
- Layer 8 mixed-region crossover. FFN transplanted from layer 18. 122% PPL recovery — the strongest graft in the series. PPL drops from 83 (ablated) to 56 (grafted), recovering past the original 61 baseline. The crossed processing pathway creates emergent behavior neither parent layer exhibits alone.
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/minKæreste", trust_remote_code=True)
39
- tokenizer = AutoTokenizer.from_pretrained("NagusameCS/minKæreste")
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
+ # minKaereste (minKæreste): "my dearest"
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-8 MLP was changed: `W8 <- W8 + 0.5 * (W18 - W8) @ P` (rank-230 projector from layer 8's `q_proj`). Created by `scripts/graft_proof.py` ("Krydsning").
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.906 | +4.1% | 88.2% | 0.049 |
32
+ | code | 1.783 | 1.844 | +6.3% | 89.6% | 0.076 |
33
+ | all | 2.324 | 2.375 | +5.2% | 88.9% | 0.063 |
34
+
35
+ | original HyperTensor test | base | this model |
36
+ |---|---|---|
37
+ | graft_proof 15-sentence PPL (mean of per-sentence PPL) | 60.96 | 56.07 |
38
+ | graft_benchmark MMLU-lite (50 items) | 31/50 | 33/50 (+2 / -0 items, sign-test p=0.50) |
39
+ | graft_benchmark BoolQ (15 items) | 6/15 | 5/15 (+0 / -1, p=1.00) |
40
+
41
+ The earlier card claimed "122% PPL recovery, strongest graft, recovers past the original baseline". 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/minKaereste")
51
+ model = AutoModelForCausalLM.from_pretrained("NagusameCS/minKaereste")
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 `minKaereste-Q8_0.gguf` and a `Modelfile`:
61
+
62
+ ```bash
63
+ hf download NagusameCS/minKaereste --local-dir minKaereste && cd minKaereste
64
+ ollama create minkaereste -f Modelfile && ollama run minkaereste
65
+ # or directly: ollama run hf.co/NagusameCS/minKaereste
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
 
minKaereste-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7629299094b15da025a71dc950ef2806d979fc83d8097645d85e75abeb2bf4d
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