miike-ai commited on
Commit
871c264
·
verified ·
1 Parent(s): eff19eb

Upload folder using huggingface_hub

Browse files
.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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags:
4
+ - llama
5
+ - kv-cache-compression
6
+ - inference-optimization
7
+ - memory-efficient
8
+ - 4-bit
9
+ - bitsandbytes
10
+ license: llama3.3
11
+ base_model: meta-llama/Llama-3.3-70B-Instruct
12
+ pipeline_tag: text-generation
13
+ ---
14
+
15
+ # LeanLlama-70B-Instruct-bnb-4bit
16
+
17
+ Llama 3.3 70B Instruct (4-bit quantized) with **256x KV cache compression** on 25% of layers (20 out of 80), reducing KV cache memory for those layers while maintaining model quality.
18
+
19
+ ## What is this?
20
+
21
+ This model applies learned linear autoencoders to compress the key-value cache in 20 of Llama's 80 transformer layers. Each KV vector (1024 dims = 8 GQA heads x 128 head_dim) is compressed to just 4 dimensions via an encoder, then reconstructed through a 2-layer decoder (4 -> 128 -> 1024) with GELU activation. Compression happens per-token at inference time with no changes to the attention mechanism itself.
22
+
23
+ The base weights are from [unsloth/Llama-3.3-70B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Llama-3.3-70B-Instruct-bnb-4bit) (NF4 quantization with double quantization).
24
+
25
+ **Key results (measured on WikiText-2):**
26
+ - Baseline perplexity (4-bit): **5.44**
27
+ - With compression: **7.55** (+2.11 points)
28
+ - Compressed layers: 40, 42, 45-51, 53-63 (upper half of the network)
29
+ - Model size: **36.8 GB** (4-bit weights + compressor weights)
30
+
31
+ These layers were selected through a per-layer compressibility sweep across all 80 layers. The upper layers (40+) have inherently low-dimensional KV subspaces and tolerate aggressive compression with minimal impact on output quality.
32
+
33
+ ## Usage
34
+
35
+ ```python
36
+ from transformers import AutoModelForCausalLM, AutoTokenizer
37
+
38
+ model = AutoModelForCausalLM.from_pretrained(
39
+ "miike-ai/LeanLlama-70B-Instruct-bnb-4bit",
40
+ trust_remote_code=True,
41
+ device_map="auto",
42
+ )
43
+ tokenizer = AutoTokenizer.from_pretrained("miike-ai/LeanLlama-70B-Instruct-bnb-4bit")
44
+
45
+ messages = [{"role": "user", "content": "What is the theory of relativity?"}]
46
+ inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
47
+ inputs = inputs.to(model.device)
48
+
49
+ outputs = model.generate(inputs, max_new_tokens=200, do_sample=True, temperature=0.7)
50
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
51
+ ```
52
+
53
+ ## How it works
54
+
55
+ Each compressed layer has two small autoencoder modules attached to the self-attention block:
56
+
57
+ - **K compressor**: `Linear(1024, 4)` encoder + `Linear(4, 128) -> GELU -> Linear(128, 1024)` decoder
58
+ - **V compressor**: Same architecture
59
+
60
+ After each forward pass, the model intercepts the KV cache and compresses the new tokens in the configured layers. The compressors use `_SafeLinear` (a custom `nn.Module`) instead of `nn.Linear` so that bitsandbytes quantization leaves them untouched — compressor weights stay in full precision.
61
+
62
+ The compressor weights add only **21 MB** to the model (280 parameters across 20 layers).
63
+
64
+ ## Layer selection methodology
65
+
66
+ All 80 layers were individually tested with compression to measure per-layer perplexity impact. Layers were added progressively in order of compressibility:
67
+
68
+ | Layers compressed | PPL increase | Status |
69
+ |-------------------|-------------|--------|
70
+ | 9 layers (safest) | +1.32 pts | Negligible impact |
71
+ | 12 layers | +2.31 pts | Minor impact |
72
+ | 15 layers | +6.16 pts | Errors compounding |
73
+ | 20 layers | +2.11 pts | Optimized selection |
74
+
75
+ The final 20-layer configuration was optimized to stay under +2.5 PPL points by selecting only layers with independently low compression cost from the upper half of the network (layers 40-63).
76
+
77
+ ## Architecture details
78
+
79
+ - **Base model**: [meta-llama/Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct)
80
+ - **Quantization**: NF4 with double quantization (via [unsloth](https://huggingface.co/unsloth/Llama-3.3-70B-Instruct-bnb-4bit))
81
+ - **Model class**: `LeanLlamaForCausalLM` (extends `LlamaForCausalLM`)
82
+ - **Compression ratio**: 256x per compressed layer (1024 -> 4 dimensions)
83
+ - **Compressed layers**: 20/80 (25%)
84
+ - **Compressor overhead**: 21 MB (negligible vs 36.8 GB model)
85
+ - **Training data for compressors**: WikiText-2 (6 epochs per layer)
86
+ - **Total size**: 36.8 GB
87
+
88
+ ## Limitations
89
+
90
+ - Compression adds a small perplexity penalty (~2 points on WikiText-2)
91
+ - The `trust_remote_code=True` flag is required since this uses a custom model class
92
+ - Compressor weights were trained on WikiText-2; other domains may see different compression quality
93
+ - This is a 4-bit quantized model; for full precision, see the base model
94
+
95
+ ## Citation
96
+
97
+ If you use this model, please cite the base model:
98
+
99
+ ```bibtex
100
+ @article{grattafiori2024llama3,
101
+ title={The Llama 3 Herd of Models},
102
+ author={Grattafiori, Aaron and others},
103
+ journal={arXiv preprint arXiv:2407.21783},
104
+ year={2024}
105
+ }
106
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LeanLlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 128000,
8
+ "dtype": "float16",
9
+ "eos_token_id": 128009,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 8192,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 28672,
15
+ "max_position_embeddings": 131072,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 64,
19
+ "num_hidden_layers": 80,
20
+ "num_key_value_heads": 8,
21
+ "pad_token_id": 128004,
22
+ "pretraining_tp": 1,
23
+ "quantization_config": {
24
+ "_load_in_4bit": true,
25
+ "_load_in_8bit": false,
26
+ "bnb_4bit_compute_dtype": "bfloat16",
27
+ "bnb_4bit_quant_storage": "uint8",
28
+ "bnb_4bit_quant_type": "nf4",
29
+ "bnb_4bit_use_double_quant": true,
30
+ "llm_int8_enable_fp32_cpu_offload": false,
31
+ "llm_int8_has_fp16_weight": false,
32
+ "llm_int8_skip_modules": [
33
+ "embed_tokens",
34
+ "embedding",
35
+ "lm_head",
36
+ "multi_modal_projector",
37
+ "merger",
38
+ "modality_projection",
39
+ "router",
40
+ "visual",
41
+ "vision_tower"
42
+ ],
43
+ "llm_int8_threshold": 6.0,
44
+ "load_in_4bit": true,
45
+ "load_in_8bit": false,
46
+ "quant_method": "bitsandbytes"
47
+ },
48
+ "rms_norm_eps": 1e-05,
49
+ "rope_scaling": {
50
+ "factor": 8.0,
51
+ "high_freq_factor": 4.0,
52
+ "low_freq_factor": 1.0,
53
+ "original_max_position_embeddings": 8192,
54
+ "rope_type": "llama3"
55
+ },
56
+ "rope_theta": 500000.0,
57
+ "tie_word_embeddings": false,
58
+ "transformers_version": "4.57.6",
59
+ "unsloth_fixed": true,
60
+ "use_cache": true,
61
+ "vocab_size": 128256,
62
+ "auto_map": {
63
+ "AutoModelForCausalLM": "modeling_lean_llama.LeanLlamaForCausalLM"
64
+ },
65
+ "leanllm_compressed_kv_layers": [
66
+ 40,
67
+ 42,
68
+ 45,
69
+ 46,
70
+ 47,
71
+ 48,
72
+ 49,
73
+ 50,
74
+ 51,
75
+ 53,
76
+ 54,
77
+ 55,
78
+ 56,
79
+ 57,
80
+ 58,
81
+ 59,
82
+ 60,
83
+ 61,
84
+ 62,
85
+ 63
86
+ ],
87
+ "leanllm_values_only": false,
88
+ "leanllm_kv_input_dims": {
89
+ "40": 1024,
90
+ "42": 1024,
91
+ "45": 1024,
92
+ "46": 1024,
93
+ "47": 1024,
94
+ "48": 1024,
95
+ "49": 1024,
96
+ "50": 1024,
97
+ "51": 1024,
98
+ "53": 1024,
99
+ "54": 1024,
100
+ "55": 1024,
101
+ "56": 1024,
102
+ "57": 1024,
103
+ "58": 1024,
104
+ "59": 1024,
105
+ "60": 1024,
106
+ "61": 1024,
107
+ "62": 1024,
108
+ "63": 1024
109
+ },
110
+ "leanllm_kv_key_dims": {
111
+ "40": 4,
112
+ "42": 4,
113
+ "45": 4,
114
+ "46": 4,
115
+ "47": 4,
116
+ "48": 4,
117
+ "49": 4,
118
+ "50": 4,
119
+ "51": 4,
120
+ "53": 4,
121
+ "54": 4,
122
+ "55": 4,
123
+ "56": 4,
124
+ "57": 4,
125
+ "58": 4,
126
+ "59": 4,
127
+ "60": 4,
128
+ "61": 4,
129
+ "62": 4,
130
+ "63": 4
131
+ },
132
+ "leanllm_kv_value_dims": {
133
+ "40": 4,
134
+ "42": 4,
135
+ "45": 4,
136
+ "46": 4,
137
+ "47": 4,
138
+ "48": 4,
139
+ "49": 4,
140
+ "50": 4,
141
+ "51": 4,
142
+ "53": 4,
143
+ "54": 4,
144
+ "55": 4,
145
+ "56": 4,
146
+ "57": 4,
147
+ "58": 4,
148
+ "59": 4,
149
+ "60": 4,
150
+ "61": 4,
151
+ "62": 4,
152
+ "63": 4
153
+ },
154
+ "leanllm_kv_decoder_depth": {
155
+ "40": 2,
156
+ "42": 2,
157
+ "45": 2,
158
+ "46": 2,
159
+ "47": 2,
160
+ "48": 2,
161
+ "49": 2,
162
+ "50": 2,
163
+ "51": 2,
164
+ "53": 2,
165
+ "54": 2,
166
+ "55": 2,
167
+ "56": 2,
168
+ "57": 2,
169
+ "58": 2,
170
+ "59": 2,
171
+ "60": 2,
172
+ "61": 2,
173
+ "62": 2,
174
+ "63": 2
175
+ },
176
+ "leanllm_kv_decoder_hidden_dim": {
177
+ "40": 128,
178
+ "42": 128,
179
+ "45": 128,
180
+ "46": 128,
181
+ "47": 128,
182
+ "48": 128,
183
+ "49": 128,
184
+ "50": 128,
185
+ "51": 128,
186
+ "53": 128,
187
+ "54": 128,
188
+ "55": 128,
189
+ "56": 128,
190
+ "57": 128,
191
+ "58": 128,
192
+ "59": 128,
193
+ "60": 128,
194
+ "61": 128,
195
+ "62": 128,
196
+ "63": 128
197
+ },
198
+ "leanllm_kv_residual_decoder": {
199
+ "40": false,
200
+ "42": false,
201
+ "45": false,
202
+ "46": false,
203
+ "47": false,
204
+ "48": false,
205
+ "49": false,
206
+ "50": false,
207
+ "51": false,
208
+ "53": false,
209
+ "54": false,
210
+ "55": false,
211
+ "56": false,
212
+ "57": false,
213
+ "58": false,
214
+ "59": false,
215
+ "60": false,
216
+ "61": false,
217
+ "62": false,
218
+ "63": false
219
+ },
220
+ "leanllm_kv_fixed_alpha": {
221
+ "40": 1.0,
222
+ "42": 1.0,
223
+ "45": 1.0,
224
+ "46": 1.0,
225
+ "47": 1.0,
226
+ "48": 1.0,
227
+ "49": 1.0,
228
+ "50": 1.0,
229
+ "51": 1.0,
230
+ "53": 1.0,
231
+ "54": 1.0,
232
+ "55": 1.0,
233
+ "56": 1.0,
234
+ "57": 1.0,
235
+ "58": 1.0,
236
+ "59": 1.0,
237
+ "60": 1.0,
238
+ "61": 1.0,
239
+ "62": 1.0,
240
+ "63": 1.0
241
+ },
242
+ "leanllm_kv_granularity": {
243
+ "40": "per_token",
244
+ "42": "per_token",
245
+ "45": "per_token",
246
+ "46": "per_token",
247
+ "47": "per_token",
248
+ "48": "per_token",
249
+ "49": "per_token",
250
+ "50": "per_token",
251
+ "51": "per_token",
252
+ "53": "per_token",
253
+ "54": "per_token",
254
+ "55": "per_token",
255
+ "56": "per_token",
256
+ "57": "per_token",
257
+ "58": "per_token",
258
+ "59": "per_token",
259
+ "60": "per_token",
260
+ "61": "per_token",
261
+ "62": "per_token",
262
+ "63": "per_token"
263
+ },
264
+ "leanllm_adaptive_compression": false,
265
+ "leanllm_adaptive_kv_layers": []
266
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 128000,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 128001,
6
+ 128008,
7
+ 128009
8
+ ],
9
+ "max_length": 131072,
10
+ "pad_token_id": 128004,
11
+ "temperature": 0.6,
12
+ "top_p": 0.9,
13
+ "transformers_version": "4.57.6"
14
+ }
leanllm_compressors.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:656bda5f92ca6b58f7cf718df96463283906f4390093b79373c3fb84b5890066
3
+ size 21990519
model-00001-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:256059d34b35d08c27b93eef739cb00713c1f6c6a967de2d89625d2447e9c55f
3
+ size 4949082283
model-00002-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f1d06ae2ae1c9a61ec5dba323f832a9dc73e06d0c8af692983114867a7f07bb
3
+ size 4977054913
model-00003-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f967a67c21f09819445b2bbc534e64d2c3d61f19ef137ff3584d1221b8281067
3
+ size 4977088063
model-00004-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84d3f7143d3308ba6fba3321b0414aefec3ef6c62f439d224c10c8ed79f9fd0e
3
+ size 4933786815
model-00005-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca520b5381c64e6fdac7ec79625b6cf7487aa080ffc7717ff71fc917095c9117
3
+ size 4977055109
model-00006-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba3bebe9ebee9b12c1be4eadd500936cb6920e5712af9eb7e8f3e45c9712b1a3
3
+ size 4977055071
model-00007-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b61a34bf6615e0dad70102addcbb4fa48cddd56c8dabe3a2963809ae140410e
3
+ size 4977088063
model-00008-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5cfe5587ea2dc4eeed79d5d5974e73958497332b889d942045500ae73808c05
3
+ size 4750027578
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
modeling_lean_llama.py ADDED
@@ -0,0 +1,766 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ LeanLlama v2: Llama with adaptive KV-cache compression.
3
+
4
+ Extends v1 (fixed-rate compression) with attention-based importance scoring:
5
+ - High-attention tokens → light compression (wide bottleneck)
6
+ - Low-attention tokens → aggressive compression (narrow bottleneck)
7
+ - Negligible tokens → evicted from cache entirely
8
+
9
+ Load with:
10
+ AutoModelForCausalLM.from_pretrained("LeanLlama-v2", trust_remote_code=True)
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from pathlib import Path
16
+ from typing import Any
17
+
18
+ import torch
19
+ from torch import nn
20
+ from transformers import LlamaConfig, LlamaForCausalLM
21
+ from transformers.cache_utils import Cache
22
+ from transformers.modeling_outputs import CausalLMOutputWithPast
23
+
24
+
25
+ # ---------------------------------------------------------------------------
26
+ # Quantization-safe linear (not nn.Linear, so bitsandbytes won't quantize)
27
+ # ---------------------------------------------------------------------------
28
+
29
+ class _SafeLinear(nn.Module):
30
+ """Drop-in replacement for nn.Linear that bitsandbytes will not quantize."""
31
+
32
+ def __init__(self, in_features: int, out_features: int, bias: bool = True) -> None:
33
+ super().__init__()
34
+ self.in_features = in_features
35
+ self.out_features = out_features
36
+ self.weight = nn.Parameter(torch.empty(out_features, in_features))
37
+ self.bias = nn.Parameter(torch.empty(out_features)) if bias else None
38
+ nn.init.kaiming_uniform_(self.weight, a=5**0.5)
39
+ if self.bias is not None:
40
+ nn.init.zeros_(self.bias)
41
+
42
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
43
+ return nn.functional.linear(x, self.weight, self.bias)
44
+
45
+
46
+ # ---------------------------------------------------------------------------
47
+ # Fixed-rate compressor (v1 — unchanged from LeanLlama-8B-INT4)
48
+ # ---------------------------------------------------------------------------
49
+
50
+ class KVVectorCompressorModule(nn.Module):
51
+ def __init__(
52
+ self,
53
+ input_dim: int,
54
+ bottleneck_dim: int,
55
+ decoder_depth: int = 2,
56
+ decoder_hidden_dim: int = 128,
57
+ residual_decoder: bool = False,
58
+ fixed_alpha: float | None = 1.0,
59
+ ) -> None:
60
+ super().__init__()
61
+ self.input_dim = input_dim
62
+ self.bottleneck_dim = bottleneck_dim
63
+ self.residual_decoder = residual_decoder
64
+
65
+ self.encoder = _SafeLinear(input_dim, bottleneck_dim)
66
+ if decoder_depth == 1:
67
+ self.decoder = nn.Sequential(_SafeLinear(bottleneck_dim, input_dim))
68
+ else:
69
+ self.decoder = nn.Sequential(
70
+ _SafeLinear(bottleneck_dim, decoder_hidden_dim),
71
+ nn.GELU(),
72
+ _SafeLinear(decoder_hidden_dim, input_dim),
73
+ )
74
+
75
+ if fixed_alpha is None:
76
+ self.alpha = nn.Parameter(torch.tensor(1.0, dtype=torch.float32))
77
+ self.register_buffer("_alpha_const", torch.tensor(0.0, dtype=torch.float32))
78
+ else:
79
+ self.register_parameter("alpha", None)
80
+ self.register_buffer("_alpha_const", torch.tensor(float(fixed_alpha), dtype=torch.float32))
81
+
82
+ def _alpha(self) -> torch.Tensor:
83
+ return self.alpha if self.alpha is not None else self._alpha_const
84
+
85
+ def encode(self, x: torch.Tensor) -> torch.Tensor:
86
+ return self.encoder(x)
87
+
88
+ def decode(self, z: torch.Tensor, x_orig: torch.Tensor | None = None) -> torch.Tensor:
89
+ out = self.decoder(z)
90
+ if self.residual_decoder and x_orig is not None:
91
+ return x_orig + self._alpha() * out
92
+ return out
93
+
94
+
95
+ # ---------------------------------------------------------------------------
96
+ # Adaptive compressor with soft dimension masking (v2)
97
+ # ---------------------------------------------------------------------------
98
+
99
+ class AdaptiveKVVectorCompressorModule(nn.Module):
100
+ """Variable-rate KV compressor using soft dimension masking.
101
+
102
+ A single encoder maps to max_bottleneck_dim dimensions. A learned
103
+ dim_priority parameter determines which dimensions are most important.
104
+ At encoding time, importance scores control how many dimensions are
105
+ active via a soft sigmoid mask:
106
+
107
+ importance=1.0 → all max_bottleneck_dim dims active (light compression)
108
+ importance=0.0 → only min_bottleneck_dim dims active (aggressive compression)
109
+ """
110
+
111
+ def __init__(
112
+ self,
113
+ input_dim: int,
114
+ max_bottleneck_dim: int = 128,
115
+ min_bottleneck_dim: int = 16,
116
+ decoder_depth: int = 2,
117
+ decoder_hidden_dim: int = 256,
118
+ fixed_alpha: float | None = 1.0,
119
+ mask_temperature: float = 5.0,
120
+ ) -> None:
121
+ super().__init__()
122
+ self.input_dim = input_dim
123
+ self.max_bottleneck_dim = max_bottleneck_dim
124
+ self.min_bottleneck_dim = min_bottleneck_dim
125
+ self.mask_temperature = mask_temperature
126
+
127
+ self.encoder = _SafeLinear(input_dim, max_bottleneck_dim)
128
+
129
+ # Learned dimension priority: which latent dims matter most
130
+ self.dim_priority = nn.Parameter(
131
+ torch.linspace(1.0, -1.0, max_bottleneck_dim)
132
+ )
133
+
134
+ if decoder_depth == 1:
135
+ self.decoder = nn.Sequential(_SafeLinear(max_bottleneck_dim, input_dim))
136
+ else:
137
+ self.decoder = nn.Sequential(
138
+ _SafeLinear(max_bottleneck_dim, decoder_hidden_dim),
139
+ nn.GELU(),
140
+ _SafeLinear(decoder_hidden_dim, input_dim),
141
+ )
142
+
143
+ if fixed_alpha is None:
144
+ self.alpha = nn.Parameter(torch.tensor(1.0, dtype=torch.float32))
145
+ self.register_buffer("_alpha_const", torch.tensor(0.0, dtype=torch.float32))
146
+ else:
147
+ self.register_parameter("alpha", None)
148
+ self.register_buffer("_alpha_const", torch.tensor(float(fixed_alpha), dtype=torch.float32))
149
+
150
+ def _alpha_val(self) -> torch.Tensor:
151
+ return self.alpha if self.alpha is not None else self._alpha_const
152
+
153
+ def compute_mask(self, importance: torch.Tensor) -> torch.Tensor:
154
+ """Compute soft dimension mask based on importance scores.
155
+
156
+ Args:
157
+ importance: [N] tensor with values in [0, 1].
158
+ Returns:
159
+ [N, max_bottleneck_dim] soft mask with values in [0, 1].
160
+ """
161
+ n_active = (
162
+ self.min_bottleneck_dim
163
+ + importance.unsqueeze(-1)
164
+ * (self.max_bottleneck_dim - self.min_bottleneck_dim)
165
+ )
166
+
167
+ _, priority_order = self.dim_priority.sort(descending=True)
168
+ rank = torch.empty_like(priority_order)
169
+ rank[priority_order] = torch.arange(
170
+ len(priority_order), device=priority_order.device
171
+ )
172
+
173
+ rank_float = rank.float().unsqueeze(0)
174
+ mask = torch.sigmoid(
175
+ self.mask_temperature * (n_active - rank_float - 0.5)
176
+ )
177
+ return mask
178
+
179
+ def effective_dims(self, importance: torch.Tensor) -> torch.Tensor:
180
+ """Approximate number of active dimensions per token."""
181
+ return self.compute_mask(importance).sum(dim=-1)
182
+
183
+ def encode(
184
+ self, x: torch.Tensor, importance: torch.Tensor | None = None
185
+ ) -> torch.Tensor:
186
+ z = self.encoder(x)
187
+ if importance is not None:
188
+ z = z * self.compute_mask(importance)
189
+ return z
190
+
191
+ def decode(self, z: torch.Tensor, x_orig: torch.Tensor | None = None) -> torch.Tensor:
192
+ out = self.decoder(z)
193
+ if x_orig is not None:
194
+ return x_orig + self._alpha_val() * out
195
+ return out
196
+
197
+
198
+ # ---------------------------------------------------------------------------
199
+ # Attention-based importance tracking
200
+ # ---------------------------------------------------------------------------
201
+
202
+ class AdaptiveCompressionState:
203
+ """Tracks cumulative attention per layer for importance scoring.
204
+
205
+ During autoregressive generation, each new token's attention weights
206
+ [B, H, 1, T] tell us how much the current query attends to each past
207
+ key. We accumulate these over time — tokens that are frequently
208
+ attended to are important.
209
+ """
210
+
211
+ def __init__(self) -> None:
212
+ self.cumulative_attention: dict[int, torch.Tensor] = {}
213
+
214
+ def update(self, layer_idx: int, attn_weights: torch.Tensor) -> None:
215
+ """Update with [B, H, 1, T] attention from current query → past keys."""
216
+ new_attn = attn_weights.squeeze(2) # [B, H, T]
217
+ if layer_idx not in self.cumulative_attention:
218
+ self.cumulative_attention[layer_idx] = new_attn.detach()
219
+ else:
220
+ prev = self.cumulative_attention[layer_idx]
221
+ t_new = new_attn.shape[-1]
222
+ t_old = prev.shape[-1]
223
+ if t_new > t_old:
224
+ pad = torch.zeros(
225
+ prev.shape[0], prev.shape[1], t_new - t_old,
226
+ device=prev.device, dtype=prev.dtype,
227
+ )
228
+ prev = torch.cat([prev, pad], dim=-1)
229
+ self.cumulative_attention[layer_idx] = prev + new_attn.detach()
230
+
231
+ def get_importance(self, layer_idx: int) -> torch.Tensor:
232
+ """Get normalized importance scores [B, T] in [0, 1]."""
233
+ cum = self.cumulative_attention[layer_idx] # [B, H, T]
234
+ mean_attn = cum.mean(dim=1) # [B, T]
235
+ mn = mean_attn.min(dim=-1, keepdim=True).values
236
+ mx = mean_attn.max(dim=-1, keepdim=True).values
237
+ return (mean_attn - mn) / (mx - mn + 1e-8)
238
+
239
+ def get_eviction_mask(
240
+ self, layer_idx: int, threshold: float,
241
+ sink_size: int = 4, recent_size: int = 64,
242
+ ) -> torch.Tensor:
243
+ """Boolean mask of tokens to KEEP (True=keep, False=evict)."""
244
+ importance = self.get_importance(layer_idx)
245
+ t = importance.shape[-1]
246
+ keep = importance >= threshold
247
+
248
+ if sink_size > 0:
249
+ keep[:, :sink_size] = True
250
+ if recent_size > 0:
251
+ keep[:, max(0, t - recent_size):] = True
252
+ return keep
253
+
254
+ def reset(self) -> None:
255
+ self.cumulative_attention.clear()
256
+
257
+
258
+ # ---------------------------------------------------------------------------
259
+ # Tensor reshaping helpers
260
+ # ---------------------------------------------------------------------------
261
+
262
+ def _kv_to_vec(x: torch.Tensor, granularity: str) -> torch.Tensor:
263
+ """[B, H, T, D] -> [B*T, H*D] (per_token) or [B*T*H, D] (per_head)."""
264
+ if granularity == "per_head":
265
+ return x.permute(0, 2, 1, 3).reshape(-1, x.shape[-1])
266
+ return x.permute(0, 2, 1, 3).reshape(-1, x.shape[1] * x.shape[3])
267
+
268
+
269
+ def _vec_to_kv(vec: torch.Tensor, ref: torch.Tensor) -> torch.Tensor:
270
+ """Inverse of _kv_to_vec: restore to [B, H, T, D]."""
271
+ b, h, t, d = ref.shape
272
+ return vec.reshape(b, t, h, d).permute(0, 2, 1, 3).contiguous()
273
+
274
+
275
+ # ---------------------------------------------------------------------------
276
+ # Compressed embedding (Phase 1 — activates when config flag is set)
277
+ # ---------------------------------------------------------------------------
278
+
279
+ class CompressedTokenEmbedding(nn.Module):
280
+ def __init__(self, vocab_size: int, compressed_dim: int, d_model: int) -> None:
281
+ super().__init__()
282
+ self.latent = nn.Embedding(vocab_size, compressed_dim)
283
+ self.decoder = nn.Sequential(
284
+ nn.Linear(compressed_dim, min(256, d_model)),
285
+ nn.GELU(),
286
+ nn.Linear(min(256, d_model), d_model),
287
+ )
288
+
289
+ def forward(self, input_ids: torch.Tensor) -> torch.Tensor:
290
+ return self.decoder(self.latent(input_ids))
291
+
292
+
293
+ # ---------------------------------------------------------------------------
294
+ # Main model class
295
+ # ---------------------------------------------------------------------------
296
+
297
+ class LeanLlamaForCausalLM(LlamaForCausalLM):
298
+ config_class = LlamaConfig
299
+ _keys_to_ignore_on_load_unexpected = [r"_leanllm_meta_l\d+"]
300
+ # _SafeLinear already prevents bitsandbytes from quantizing compressor modules
301
+
302
+ @classmethod
303
+ def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs):
304
+ """Load LeanLlama: resolves base model, loads compressor weights automatically."""
305
+ model_dir = Path(pretrained_model_name_or_path)
306
+
307
+ # If the directory has a config with a base model reference, load base weights from there
308
+ config_path = model_dir / "config.json" if model_dir.is_dir() else None
309
+ base_model = None
310
+ if config_path and config_path.exists():
311
+ import json
312
+ with config_path.open() as f:
313
+ cfg = json.load(f)
314
+ base_model = cfg.get("leanllm_base_model")
315
+
316
+ if base_model:
317
+ # Load config from our directory (has compression settings)
318
+ from transformers import AutoConfig
319
+ config = AutoConfig.from_pretrained(str(model_dir), trust_remote_code=True)
320
+ kwargs["config"] = config
321
+ # Load weights from the base model on HF Hub
322
+ model = super().from_pretrained(base_model, *args, **kwargs)
323
+ else:
324
+ model = super().from_pretrained(pretrained_model_name_or_path, *args, **kwargs)
325
+
326
+ # Auto-load compressor weights if present
327
+ comp_path = model_dir / "leanllm_compressors.pt" if model_dir.is_dir() else None
328
+ if comp_path and comp_path.exists():
329
+ state = torch.load(comp_path, map_location="cpu", weights_only=False)
330
+ missing, unexpected = model.load_state_dict(state, strict=False)
331
+ real_missing = [k for k in missing if "leanllm" in k]
332
+ if real_missing:
333
+ print(f"Warning: missing LeanLLM keys: {real_missing}")
334
+ print(f"[LeanLlama] Loaded {len(state)} compressor params for {len(model._kv_layers)} layers")
335
+
336
+ # Auto-load reconstructed embeddings if present
337
+ embed_path = model_dir / "leanllm_reconstructed_embeddings.pt" if model_dir.is_dir() else None
338
+ if embed_path and embed_path.exists():
339
+ embed_data = torch.load(embed_path, map_location="cpu", weights_only=False)
340
+ embed_layer = model.get_input_embeddings()
341
+ with torch.no_grad():
342
+ embed_layer.weight.copy_(
343
+ embed_data["weight"].to(embed_layer.weight.dtype)
344
+ )
345
+ print("[LeanLlama] Loaded reconstructed embeddings")
346
+
347
+ return model
348
+
349
+ def __init__(self, config: LlamaConfig) -> None:
350
+ super().__init__(config)
351
+
352
+ # --- Phase 1: Embedding compression (inactive unless config says so) ---
353
+ emb_cfg = getattr(config, "leanllm_embedding_compression", None)
354
+ if emb_cfg and emb_cfg.get("enabled"):
355
+ cdim = int(emb_cfg["compressed_dim"])
356
+ self.model.embed_tokens = CompressedTokenEmbedding(
357
+ vocab_size=config.vocab_size,
358
+ compressed_dim=cdim,
359
+ d_model=config.hidden_size,
360
+ )
361
+
362
+ # --- Phase 2: Fixed-rate KV-cache compression (v1) ---
363
+ self._kv_layers: list[int] = [
364
+ int(x) for x in getattr(config, "leanllm_compressed_kv_layers", [])
365
+ ]
366
+ self._values_only: bool = bool(getattr(config, "leanllm_values_only", True))
367
+
368
+ kv_input_dims: dict[str, int] = dict(getattr(config, "leanllm_kv_input_dims", {}))
369
+ kv_value_dims: dict[str, int] = dict(getattr(config, "leanllm_kv_value_dims", {}))
370
+ kv_key_dims: dict[str, int] = dict(getattr(config, "leanllm_kv_key_dims", {}))
371
+ kv_decoder_depth: dict[str, int] = dict(getattr(config, "leanllm_kv_decoder_depth", {}))
372
+ kv_decoder_hidden: dict[str, int] = dict(getattr(config, "leanllm_kv_decoder_hidden_dim", {}))
373
+ kv_residual: dict[str, bool] = dict(getattr(config, "leanllm_kv_residual_decoder", {}))
374
+ kv_fixed_alpha: dict[str, float | None] = dict(getattr(config, "leanllm_kv_fixed_alpha", {}))
375
+ kv_granularity: dict[str, str] = dict(getattr(config, "leanllm_kv_granularity", {}))
376
+
377
+ self._kv_granularity_map: dict[int, str] = {}
378
+ self._compressed_up_to: dict[int, int] = {}
379
+
380
+ for layer_idx in self._kv_layers:
381
+ key = str(layer_idx)
382
+ in_dim = int(kv_input_dims[key])
383
+ d_depth = int(kv_decoder_depth.get(key, 2))
384
+ d_hidden = int(kv_decoder_hidden.get(key, 128))
385
+ r_dec = bool(kv_residual.get(key, False))
386
+ f_alpha = kv_fixed_alpha.get(key, 1.0)
387
+ if f_alpha is not None:
388
+ f_alpha = float(f_alpha)
389
+ self._kv_granularity_map[layer_idx] = kv_granularity.get(key, "per_token")
390
+ self._compressed_up_to[layer_idx] = 0
391
+
392
+ v_dim = int(kv_value_dims[key])
393
+ v_mod = KVVectorCompressorModule(
394
+ input_dim=in_dim,
395
+ bottleneck_dim=v_dim,
396
+ decoder_depth=d_depth,
397
+ decoder_hidden_dim=d_hidden,
398
+ residual_decoder=r_dec,
399
+ fixed_alpha=f_alpha,
400
+ )
401
+ self.model.layers[layer_idx].self_attn.leanllm_v_compressor = v_mod
402
+
403
+ if not self._values_only and key in kv_key_dims:
404
+ k_dim = int(kv_key_dims[key])
405
+ k_mod = KVVectorCompressorModule(
406
+ input_dim=in_dim,
407
+ bottleneck_dim=k_dim,
408
+ decoder_depth=d_depth,
409
+ decoder_hidden_dim=d_hidden,
410
+ residual_decoder=r_dec,
411
+ fixed_alpha=f_alpha,
412
+ )
413
+ self.model.layers[layer_idx].self_attn.leanllm_k_compressor = k_mod
414
+
415
+ # --- Phase 2b: Adaptive KV-cache compression (v2) ---
416
+ self._adaptive_enabled: bool = bool(
417
+ getattr(config, "leanllm_adaptive_compression", False)
418
+ )
419
+ self._adaptive_layers: list[int] = [
420
+ int(x) for x in getattr(config, "leanllm_adaptive_kv_layers", [])
421
+ ]
422
+ self._attn_state: AdaptiveCompressionState | None = None
423
+ self._adaptive_granularity_map: dict[int, str] = {}
424
+ self._adaptive_compressed_up_to: dict[int, int] = {}
425
+
426
+ # Eviction config
427
+ eviction_cfg = getattr(config, "leanllm_eviction", None) or {}
428
+ self._eviction_enabled: bool = bool(eviction_cfg.get("enabled", False))
429
+ self._eviction_threshold: float = float(eviction_cfg.get("threshold", 0.05))
430
+ self._eviction_sink_size: int = int(eviction_cfg.get("sink_size", 4))
431
+ self._eviction_recent_size: int = int(eviction_cfg.get("recent_size", 128))
432
+ self._eviction_interval: int = int(eviction_cfg.get("interval", 64))
433
+ self._generation_step: int = 0
434
+
435
+ adaptive_cfg = getattr(config, "leanllm_adaptive_kv_config", {}) or {}
436
+ for layer_idx in self._adaptive_layers:
437
+ key = str(layer_idx)
438
+ layer_cfg = adaptive_cfg.get(key, {})
439
+ in_dim = int(layer_cfg.get("input_dim", kv_input_dims.get(key, config.num_key_value_heads * config.head_dim)))
440
+ max_bn = int(layer_cfg.get("max_bottleneck_dim", 128))
441
+ min_bn = int(layer_cfg.get("min_bottleneck_dim", 16))
442
+ d_depth = int(layer_cfg.get("decoder_depth", 2))
443
+ d_hidden = int(layer_cfg.get("decoder_hidden_dim", 256))
444
+ f_alpha = layer_cfg.get("fixed_alpha", 1.0)
445
+ if f_alpha is not None:
446
+ f_alpha = float(f_alpha)
447
+ mask_temp = float(layer_cfg.get("mask_temperature", 5.0))
448
+ gran = str(layer_cfg.get("granularity", "per_token"))
449
+
450
+ self._adaptive_granularity_map[layer_idx] = gran
451
+ self._adaptive_compressed_up_to[layer_idx] = 0
452
+
453
+ v_mod = AdaptiveKVVectorCompressorModule(
454
+ input_dim=in_dim,
455
+ max_bottleneck_dim=max_bn,
456
+ min_bottleneck_dim=min_bn,
457
+ decoder_depth=d_depth,
458
+ decoder_hidden_dim=d_hidden,
459
+ fixed_alpha=f_alpha,
460
+ mask_temperature=mask_temp,
461
+ )
462
+ self.model.layers[layer_idx].self_attn.leanllm_adaptive_v_compressor = v_mod
463
+
464
+ if self._adaptive_enabled and self._adaptive_layers:
465
+ self._attn_state = AdaptiveCompressionState()
466
+
467
+ # ------------------------------------------------------------------
468
+ # Fixed-rate compression (v1)
469
+ # ------------------------------------------------------------------
470
+
471
+ def _compress_values(self, v: torch.Tensor, layer_idx: int, start: int) -> torch.Tensor:
472
+ if start >= v.shape[2]:
473
+ return v
474
+ v_new = v[:, :, start:, :]
475
+ gran = self._kv_granularity_map[layer_idx]
476
+ v_dtype = v.dtype
477
+ compressor = self.model.layers[layer_idx].self_attn.leanllm_v_compressor
478
+ comp_dtype = compressor.encoder.weight.dtype
479
+ v_vec = _kv_to_vec(v_new, gran).to(comp_dtype)
480
+ v_rec = compressor.decode(compressor.encode(v_vec), x_orig=None)
481
+ v_compressed = _vec_to_kv(v_rec, v_new).to(dtype=v_dtype)
482
+ if start == 0:
483
+ return v_compressed
484
+ return torch.cat([v[:, :, :start, :], v_compressed], dim=2)
485
+
486
+ def _compress_keys(self, k: torch.Tensor, layer_idx: int, start: int) -> torch.Tensor:
487
+ if start >= k.shape[2]:
488
+ return k
489
+ k_new = k[:, :, start:, :]
490
+ gran = self._kv_granularity_map[layer_idx]
491
+ k_dtype = k.dtype
492
+ k_comp = self.model.layers[layer_idx].self_attn.leanllm_k_compressor
493
+ comp_dtype = k_comp.encoder.weight.dtype
494
+ k_vec = _kv_to_vec(k_new, gran).to(comp_dtype)
495
+ k_rec = k_comp.decode(k_comp.encode(k_vec), x_orig=None)
496
+ k_compressed = _vec_to_kv(k_rec, k_new).to(dtype=k_dtype)
497
+ if start == 0:
498
+ return k_compressed
499
+ return torch.cat([k[:, :, :start, :], k_compressed], dim=2)
500
+
501
+ def _compress_past_fixed(self, past_key_values: Any) -> Any:
502
+ """Apply fixed-rate v1 compression to KV cache."""
503
+ if past_key_values is None or not self._kv_layers:
504
+ return past_key_values
505
+
506
+ if isinstance(past_key_values, Cache):
507
+ for layer_idx in self._kv_layers:
508
+ if layer_idx in self._adaptive_layers:
509
+ continue # handled by adaptive path
510
+ layer_cache = past_key_values.layers[layer_idx]
511
+ v = layer_cache.values
512
+ total_tokens = v.shape[2]
513
+ start = self._compressed_up_to[layer_idx]
514
+
515
+ layer_cache.values = self._compress_values(v, layer_idx, start)
516
+
517
+ if not self._values_only and hasattr(
518
+ self.model.layers[layer_idx].self_attn, "leanllm_k_compressor"
519
+ ):
520
+ layer_cache.keys = self._compress_keys(
521
+ layer_cache.keys, layer_idx, start
522
+ )
523
+ self._compressed_up_to[layer_idx] = total_tokens
524
+ return past_key_values
525
+
526
+ if isinstance(past_key_values, tuple):
527
+ past_list = list(past_key_values)
528
+ for layer_idx in self._kv_layers:
529
+ if layer_idx in self._adaptive_layers:
530
+ continue
531
+ k, v = past_list[layer_idx]
532
+ total_tokens = v.shape[2]
533
+ start = self._compressed_up_to[layer_idx]
534
+
535
+ v_new = self._compress_values(v, layer_idx, start)
536
+ if not self._values_only and hasattr(
537
+ self.model.layers[layer_idx].self_attn, "leanllm_k_compressor"
538
+ ):
539
+ k_new = self._compress_keys(k, layer_idx, start)
540
+ else:
541
+ k_new = k
542
+ past_list[layer_idx] = (k_new, v_new)
543
+ self._compressed_up_to[layer_idx] = total_tokens
544
+ return tuple(past_list)
545
+
546
+ return past_key_values
547
+
548
+ # ------------------------------------------------------------------
549
+ # Adaptive compression (v2)
550
+ # ------------------------------------------------------------------
551
+
552
+ def _compress_values_adaptive(
553
+ self,
554
+ v: torch.Tensor,
555
+ layer_idx: int,
556
+ importance: torch.Tensor | None,
557
+ start: int,
558
+ ) -> torch.Tensor:
559
+ """Compress values with importance-based soft masking."""
560
+ if start >= v.shape[2]:
561
+ return v
562
+ v_new = v[:, :, start:, :]
563
+ gran = self._adaptive_granularity_map[layer_idx]
564
+ v_dtype = v.dtype
565
+ compressor = self.model.layers[layer_idx].self_attn.leanllm_adaptive_v_compressor
566
+ comp_dtype = compressor.encoder.weight.dtype
567
+ v_vec = _kv_to_vec(v_new, gran).to(comp_dtype)
568
+
569
+ # Build per-vector importance from per-token importance
570
+ imp = None
571
+ if importance is not None:
572
+ b, h, t_new, d = v_new.shape
573
+ # importance is [B, T_total] — slice to match new tokens
574
+ imp_slice = importance[:, start:] # [B, t_new]
575
+ if gran == "per_head":
576
+ imp = imp_slice.unsqueeze(2).expand(b, t_new, h).reshape(-1)
577
+ else:
578
+ imp = imp_slice.reshape(-1)
579
+ imp = imp.to(comp_dtype)
580
+
581
+ z = compressor.encode(v_vec, importance=imp)
582
+ v_rec = compressor.decode(z, x_orig=None)
583
+ v_compressed = _vec_to_kv(v_rec, v_new).to(dtype=v_dtype)
584
+ if start == 0:
585
+ return v_compressed
586
+ return torch.cat([v[:, :, :start, :], v_compressed], dim=2)
587
+
588
+ def _get_token_importance(self, layer_idx: int) -> torch.Tensor | None:
589
+ """Get importance scores for all tokens at a layer.
590
+
591
+ For the newest token (which has zero cumulative attention), uses
592
+ the median importance of existing tokens as a proxy.
593
+ """
594
+ if self._attn_state is None:
595
+ return None
596
+ if layer_idx not in self._attn_state.cumulative_attention:
597
+ return None
598
+
599
+ imp_all = self._attn_state.get_importance(layer_idx) # [B, T]
600
+ if imp_all.shape[-1] <= 1:
601
+ return torch.full_like(imp_all, 0.5)
602
+
603
+ # The last token always has importance=0 (it's new, no future queries yet).
604
+ # Replace it with the median of existing tokens as a proxy.
605
+ imp_existing = imp_all[:, :-1]
606
+ median_imp = imp_existing.median(dim=-1, keepdim=True).values
607
+ imp_fixed = torch.cat([imp_existing, median_imp], dim=-1)
608
+ return imp_fixed
609
+
610
+ def _compress_past_adaptive(
611
+ self,
612
+ past_key_values: Any,
613
+ attentions: tuple | None,
614
+ ) -> Any:
615
+ """Apply adaptive importance-based compression to KV cache."""
616
+ if past_key_values is None or not self._adaptive_layers:
617
+ return past_key_values
618
+ if self._attn_state is None:
619
+ return past_key_values
620
+
621
+ # Update cumulative attention state from this forward pass
622
+ if attentions is not None:
623
+ for layer_idx in self._adaptive_layers:
624
+ if layer_idx < len(attentions) and attentions[layer_idx] is not None:
625
+ self._attn_state.update(layer_idx, attentions[layer_idx])
626
+
627
+ if isinstance(past_key_values, Cache):
628
+ for layer_idx in self._adaptive_layers:
629
+ layer_cache = past_key_values.layers[layer_idx]
630
+ v = layer_cache.values
631
+ total_tokens = v.shape[2]
632
+ start = self._adaptive_compressed_up_to[layer_idx]
633
+
634
+ importance = self._get_token_importance(layer_idx)
635
+ layer_cache.values = self._compress_values_adaptive(
636
+ v, layer_idx, importance, start
637
+ )
638
+ self._adaptive_compressed_up_to[layer_idx] = total_tokens
639
+
640
+ # Token eviction
641
+ if self._eviction_enabled and self._generation_step > 0:
642
+ if self._generation_step % self._eviction_interval == 0:
643
+ past_key_values = self._evict_tokens(past_key_values)
644
+
645
+ return past_key_values
646
+
647
+ if isinstance(past_key_values, tuple):
648
+ past_list = list(past_key_values)
649
+ for layer_idx in self._adaptive_layers:
650
+ k, v = past_list[layer_idx]
651
+ total_tokens = v.shape[2]
652
+ start = self._adaptive_compressed_up_to[layer_idx]
653
+
654
+ importance = self._get_token_importance(layer_idx)
655
+ v_new = self._compress_values_adaptive(
656
+ v, layer_idx, importance, start
657
+ )
658
+ past_list[layer_idx] = (k, v_new)
659
+ self._adaptive_compressed_up_to[layer_idx] = total_tokens
660
+ return tuple(past_list)
661
+
662
+ return past_key_values
663
+
664
+ # ------------------------------------------------------------------
665
+ # Token eviction
666
+ # ------------------------------------------------------------------
667
+
668
+ def _evict_tokens(self, past_key_values: Any) -> Any:
669
+ """Remove low-importance tokens from the KV cache."""
670
+ if not isinstance(past_key_values, Cache):
671
+ return past_key_values
672
+ if self._attn_state is None:
673
+ return past_key_values
674
+
675
+ # Find tokens to keep across all adaptive layers (intersection)
676
+ keep_mask = None
677
+ for layer_idx in self._adaptive_layers:
678
+ if layer_idx not in self._attn_state.cumulative_attention:
679
+ continue
680
+ layer_mask = self._attn_state.get_eviction_mask(
681
+ layer_idx,
682
+ threshold=self._eviction_threshold,
683
+ sink_size=self._eviction_sink_size,
684
+ recent_size=self._eviction_recent_size,
685
+ )
686
+ if keep_mask is None:
687
+ keep_mask = layer_mask
688
+ else:
689
+ keep_mask = keep_mask & layer_mask # conservative: keep if ANY layer needs it
690
+
691
+ if keep_mask is None:
692
+ return past_key_values
693
+
694
+ # Only evict if we'd actually remove tokens
695
+ n_keep = int(keep_mask[0].sum().item())
696
+ n_total = keep_mask.shape[-1]
697
+ if n_keep >= n_total:
698
+ return past_key_values
699
+
700
+ # Apply eviction to ALL layers (both fixed and adaptive)
701
+ keep_indices = keep_mask[0].nonzero(as_tuple=True)[0] # [n_keep]
702
+ n_layers = len(past_key_values.layers)
703
+ for layer_idx in range(n_layers):
704
+ layer_cache = past_key_values.layers[layer_idx]
705
+ k = layer_cache.keys # [B, H, T, D]
706
+ v = layer_cache.values
707
+ if k.shape[2] != n_total:
708
+ continue # skip if size mismatch (shouldn't happen)
709
+
710
+ layer_cache.keys = k[:, :, keep_indices, :]
711
+ layer_cache.values = v[:, :, keep_indices, :]
712
+
713
+ # Reset compression tracking
714
+ for layer_idx in self._kv_layers:
715
+ self._compressed_up_to[layer_idx] = n_keep
716
+ for layer_idx in self._adaptive_layers:
717
+ self._adaptive_compressed_up_to[layer_idx] = n_keep
718
+
719
+ # Reset attention state (scores are invalidated by eviction)
720
+ self._attn_state.reset()
721
+
722
+ return past_key_values
723
+
724
+ # ------------------------------------------------------------------
725
+ # Forward
726
+ # ------------------------------------------------------------------
727
+
728
+ def forward(self, *args: Any, **kwargs: Any) -> CausalLMOutputWithPast:
729
+ # Reset compression tracking when starting a new sequence
730
+ past = kwargs.get("past_key_values", None)
731
+ if past is None and len(args) < 5:
732
+ for layer_idx in self._kv_layers:
733
+ self._compressed_up_to[layer_idx] = 0
734
+ for layer_idx in self._adaptive_layers:
735
+ self._adaptive_compressed_up_to[layer_idx] = 0
736
+ if self._attn_state is not None:
737
+ self._attn_state.reset()
738
+ self._generation_step = 0
739
+
740
+ # For adaptive compression, request attention weights during generation
741
+ # (single-token steps only — prefill is too expensive with eager attention)
742
+ need_attentions = (
743
+ self._adaptive_enabled
744
+ and self._adaptive_layers
745
+ and past is not None # generation step, not prefill
746
+ )
747
+ if need_attentions:
748
+ kwargs.setdefault("output_attentions", True)
749
+
750
+ outputs = super().forward(*args, **kwargs)
751
+
752
+ if hasattr(outputs, "past_key_values"):
753
+ # Apply fixed-rate compression (v1 layers)
754
+ outputs.past_key_values = self._compress_past_fixed(
755
+ outputs.past_key_values
756
+ )
757
+
758
+ # Apply adaptive compression (v2 layers)
759
+ if self._adaptive_enabled:
760
+ attentions = getattr(outputs, "attentions", None)
761
+ outputs.past_key_values = self._compress_past_adaptive(
762
+ outputs.past_key_values, attentions
763
+ )
764
+
765
+ self._generation_step += 1
766
+ return outputs
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|eot_id|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad_id|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
tokenizer_config.json ADDED
@@ -0,0 +1,2066 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "added_tokens_decoder": {
4
+ "128000": {
5
+ "content": "<|begin_of_text|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "128001": {
13
+ "content": "<|end_of_text|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "128002": {
21
+ "content": "<|reserved_special_token_0|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "128003": {
29
+ "content": "<|reserved_special_token_1|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "128004": {
37
+ "content": "<|finetune_right_pad_id|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "128005": {
45
+ "content": "<|reserved_special_token_2|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "128006": {
53
+ "content": "<|start_header_id|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "128007": {
61
+ "content": "<|end_header_id|>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "128008": {
69
+ "content": "<|eom_id|>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "128009": {
77
+ "content": "<|eot_id|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "128010": {
85
+ "content": "<|python_tag|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "128011": {
93
+ "content": "<|reserved_special_token_3|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "128012": {
101
+ "content": "<|reserved_special_token_4|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "128013": {
109
+ "content": "<|reserved_special_token_5|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "128014": {
117
+ "content": "<|reserved_special_token_6|>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "128015": {
125
+ "content": "<|reserved_special_token_7|>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "128016": {
133
+ "content": "<|reserved_special_token_8|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "128017": {
141
+ "content": "<|reserved_special_token_9|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ },
148
+ "128018": {
149
+ "content": "<|reserved_special_token_10|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": true
155
+ },
156
+ "128019": {
157
+ "content": "<|reserved_special_token_11|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": true
163
+ },
164
+ "128020": {
165
+ "content": "<|reserved_special_token_12|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": true
171
+ },
172
+ "128021": {
173
+ "content": "<|reserved_special_token_13|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": true
179
+ },
180
+ "128022": {
181
+ "content": "<|reserved_special_token_14|>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": true
187
+ },
188
+ "128023": {
189
+ "content": "<|reserved_special_token_15|>",
190
+ "lstrip": false,
191
+ "normalized": false,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": true
195
+ },
196
+ "128024": {
197
+ "content": "<|reserved_special_token_16|>",
198
+ "lstrip": false,
199
+ "normalized": false,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": true
203
+ },
204
+ "128025": {
205
+ "content": "<|reserved_special_token_17|>",
206
+ "lstrip": false,
207
+ "normalized": false,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": true
211
+ },
212
+ "128026": {
213
+ "content": "<|reserved_special_token_18|>",
214
+ "lstrip": false,
215
+ "normalized": false,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": true
219
+ },
220
+ "128027": {
221
+ "content": "<|reserved_special_token_19|>",
222
+ "lstrip": false,
223
+ "normalized": false,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": true
227
+ },
228
+ "128028": {
229
+ "content": "<|reserved_special_token_20|>",
230
+ "lstrip": false,
231
+ "normalized": false,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": true
235
+ },
236
+ "128029": {
237
+ "content": "<|reserved_special_token_21|>",
238
+ "lstrip": false,
239
+ "normalized": false,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": true
243
+ },
244
+ "128030": {
245
+ "content": "<|reserved_special_token_22|>",
246
+ "lstrip": false,
247
+ "normalized": false,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": true
251
+ },
252
+ "128031": {
253
+ "content": "<|reserved_special_token_23|>",
254
+ "lstrip": false,
255
+ "normalized": false,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": true
259
+ },
260
+ "128032": {
261
+ "content": "<|reserved_special_token_24|>",
262
+ "lstrip": false,
263
+ "normalized": false,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": true
267
+ },
268
+ "128033": {
269
+ "content": "<|reserved_special_token_25|>",
270
+ "lstrip": false,
271
+ "normalized": false,
272
+ "rstrip": false,
273
+ "single_word": false,
274
+ "special": true
275
+ },
276
+ "128034": {
277
+ "content": "<|reserved_special_token_26|>",
278
+ "lstrip": false,
279
+ "normalized": false,
280
+ "rstrip": false,
281
+ "single_word": false,
282
+ "special": true
283
+ },
284
+ "128035": {
285
+ "content": "<|reserved_special_token_27|>",
286
+ "lstrip": false,
287
+ "normalized": false,
288
+ "rstrip": false,
289
+ "single_word": false,
290
+ "special": true
291
+ },
292
+ "128036": {
293
+ "content": "<|reserved_special_token_28|>",
294
+ "lstrip": false,
295
+ "normalized": false,
296
+ "rstrip": false,
297
+ "single_word": false,
298
+ "special": true
299
+ },
300
+ "128037": {
301
+ "content": "<|reserved_special_token_29|>",
302
+ "lstrip": false,
303
+ "normalized": false,
304
+ "rstrip": false,
305
+ "single_word": false,
306
+ "special": true
307
+ },
308
+ "128038": {
309
+ "content": "<|reserved_special_token_30|>",
310
+ "lstrip": false,
311
+ "normalized": false,
312
+ "rstrip": false,
313
+ "single_word": false,
314
+ "special": true
315
+ },
316
+ "128039": {
317
+ "content": "<|reserved_special_token_31|>",
318
+ "lstrip": false,
319
+ "normalized": false,
320
+ "rstrip": false,
321
+ "single_word": false,
322
+ "special": true
323
+ },
324
+ "128040": {
325
+ "content": "<|reserved_special_token_32|>",
326
+ "lstrip": false,
327
+ "normalized": false,
328
+ "rstrip": false,
329
+ "single_word": false,
330
+ "special": true
331
+ },
332
+ "128041": {
333
+ "content": "<|reserved_special_token_33|>",
334
+ "lstrip": false,
335
+ "normalized": false,
336
+ "rstrip": false,
337
+ "single_word": false,
338
+ "special": true
339
+ },
340
+ "128042": {
341
+ "content": "<|reserved_special_token_34|>",
342
+ "lstrip": false,
343
+ "normalized": false,
344
+ "rstrip": false,
345
+ "single_word": false,
346
+ "special": true
347
+ },
348
+ "128043": {
349
+ "content": "<|reserved_special_token_35|>",
350
+ "lstrip": false,
351
+ "normalized": false,
352
+ "rstrip": false,
353
+ "single_word": false,
354
+ "special": true
355
+ },
356
+ "128044": {
357
+ "content": "<|reserved_special_token_36|>",
358
+ "lstrip": false,
359
+ "normalized": false,
360
+ "rstrip": false,
361
+ "single_word": false,
362
+ "special": true
363
+ },
364
+ "128045": {
365
+ "content": "<|reserved_special_token_37|>",
366
+ "lstrip": false,
367
+ "normalized": false,
368
+ "rstrip": false,
369
+ "single_word": false,
370
+ "special": true
371
+ },
372
+ "128046": {
373
+ "content": "<|reserved_special_token_38|>",
374
+ "lstrip": false,
375
+ "normalized": false,
376
+ "rstrip": false,
377
+ "single_word": false,
378
+ "special": true
379
+ },
380
+ "128047": {
381
+ "content": "<|reserved_special_token_39|>",
382
+ "lstrip": false,
383
+ "normalized": false,
384
+ "rstrip": false,
385
+ "single_word": false,
386
+ "special": true
387
+ },
388
+ "128048": {
389
+ "content": "<|reserved_special_token_40|>",
390
+ "lstrip": false,
391
+ "normalized": false,
392
+ "rstrip": false,
393
+ "single_word": false,
394
+ "special": true
395
+ },
396
+ "128049": {
397
+ "content": "<|reserved_special_token_41|>",
398
+ "lstrip": false,
399
+ "normalized": false,
400
+ "rstrip": false,
401
+ "single_word": false,
402
+ "special": true
403
+ },
404
+ "128050": {
405
+ "content": "<|reserved_special_token_42|>",
406
+ "lstrip": false,
407
+ "normalized": false,
408
+ "rstrip": false,
409
+ "single_word": false,
410
+ "special": true
411
+ },
412
+ "128051": {
413
+ "content": "<|reserved_special_token_43|>",
414
+ "lstrip": false,
415
+ "normalized": false,
416
+ "rstrip": false,
417
+ "single_word": false,
418
+ "special": true
419
+ },
420
+ "128052": {
421
+ "content": "<|reserved_special_token_44|>",
422
+ "lstrip": false,
423
+ "normalized": false,
424
+ "rstrip": false,
425
+ "single_word": false,
426
+ "special": true
427
+ },
428
+ "128053": {
429
+ "content": "<|reserved_special_token_45|>",
430
+ "lstrip": false,
431
+ "normalized": false,
432
+ "rstrip": false,
433
+ "single_word": false,
434
+ "special": true
435
+ },
436
+ "128054": {
437
+ "content": "<|reserved_special_token_46|>",
438
+ "lstrip": false,
439
+ "normalized": false,
440
+ "rstrip": false,
441
+ "single_word": false,
442
+ "special": true
443
+ },
444
+ "128055": {
445
+ "content": "<|reserved_special_token_47|>",
446
+ "lstrip": false,
447
+ "normalized": false,
448
+ "rstrip": false,
449
+ "single_word": false,
450
+ "special": true
451
+ },
452
+ "128056": {
453
+ "content": "<|reserved_special_token_48|>",
454
+ "lstrip": false,
455
+ "normalized": false,
456
+ "rstrip": false,
457
+ "single_word": false,
458
+ "special": true
459
+ },
460
+ "128057": {
461
+ "content": "<|reserved_special_token_49|>",
462
+ "lstrip": false,
463
+ "normalized": false,
464
+ "rstrip": false,
465
+ "single_word": false,
466
+ "special": true
467
+ },
468
+ "128058": {
469
+ "content": "<|reserved_special_token_50|>",
470
+ "lstrip": false,
471
+ "normalized": false,
472
+ "rstrip": false,
473
+ "single_word": false,
474
+ "special": true
475
+ },
476
+ "128059": {
477
+ "content": "<|reserved_special_token_51|>",
478
+ "lstrip": false,
479
+ "normalized": false,
480
+ "rstrip": false,
481
+ "single_word": false,
482
+ "special": true
483
+ },
484
+ "128060": {
485
+ "content": "<|reserved_special_token_52|>",
486
+ "lstrip": false,
487
+ "normalized": false,
488
+ "rstrip": false,
489
+ "single_word": false,
490
+ "special": true
491
+ },
492
+ "128061": {
493
+ "content": "<|reserved_special_token_53|>",
494
+ "lstrip": false,
495
+ "normalized": false,
496
+ "rstrip": false,
497
+ "single_word": false,
498
+ "special": true
499
+ },
500
+ "128062": {
501
+ "content": "<|reserved_special_token_54|>",
502
+ "lstrip": false,
503
+ "normalized": false,
504
+ "rstrip": false,
505
+ "single_word": false,
506
+ "special": true
507
+ },
508
+ "128063": {
509
+ "content": "<|reserved_special_token_55|>",
510
+ "lstrip": false,
511
+ "normalized": false,
512
+ "rstrip": false,
513
+ "single_word": false,
514
+ "special": true
515
+ },
516
+ "128064": {
517
+ "content": "<|reserved_special_token_56|>",
518
+ "lstrip": false,
519
+ "normalized": false,
520
+ "rstrip": false,
521
+ "single_word": false,
522
+ "special": true
523
+ },
524
+ "128065": {
525
+ "content": "<|reserved_special_token_57|>",
526
+ "lstrip": false,
527
+ "normalized": false,
528
+ "rstrip": false,
529
+ "single_word": false,
530
+ "special": true
531
+ },
532
+ "128066": {
533
+ "content": "<|reserved_special_token_58|>",
534
+ "lstrip": false,
535
+ "normalized": false,
536
+ "rstrip": false,
537
+ "single_word": false,
538
+ "special": true
539
+ },
540
+ "128067": {
541
+ "content": "<|reserved_special_token_59|>",
542
+ "lstrip": false,
543
+ "normalized": false,
544
+ "rstrip": false,
545
+ "single_word": false,
546
+ "special": true
547
+ },
548
+ "128068": {
549
+ "content": "<|reserved_special_token_60|>",
550
+ "lstrip": false,
551
+ "normalized": false,
552
+ "rstrip": false,
553
+ "single_word": false,
554
+ "special": true
555
+ },
556
+ "128069": {
557
+ "content": "<|reserved_special_token_61|>",
558
+ "lstrip": false,
559
+ "normalized": false,
560
+ "rstrip": false,
561
+ "single_word": false,
562
+ "special": true
563
+ },
564
+ "128070": {
565
+ "content": "<|reserved_special_token_62|>",
566
+ "lstrip": false,
567
+ "normalized": false,
568
+ "rstrip": false,
569
+ "single_word": false,
570
+ "special": true
571
+ },
572
+ "128071": {
573
+ "content": "<|reserved_special_token_63|>",
574
+ "lstrip": false,
575
+ "normalized": false,
576
+ "rstrip": false,
577
+ "single_word": false,
578
+ "special": true
579
+ },
580
+ "128072": {
581
+ "content": "<|reserved_special_token_64|>",
582
+ "lstrip": false,
583
+ "normalized": false,
584
+ "rstrip": false,
585
+ "single_word": false,
586
+ "special": true
587
+ },
588
+ "128073": {
589
+ "content": "<|reserved_special_token_65|>",
590
+ "lstrip": false,
591
+ "normalized": false,
592
+ "rstrip": false,
593
+ "single_word": false,
594
+ "special": true
595
+ },
596
+ "128074": {
597
+ "content": "<|reserved_special_token_66|>",
598
+ "lstrip": false,
599
+ "normalized": false,
600
+ "rstrip": false,
601
+ "single_word": false,
602
+ "special": true
603
+ },
604
+ "128075": {
605
+ "content": "<|reserved_special_token_67|>",
606
+ "lstrip": false,
607
+ "normalized": false,
608
+ "rstrip": false,
609
+ "single_word": false,
610
+ "special": true
611
+ },
612
+ "128076": {
613
+ "content": "<|reserved_special_token_68|>",
614
+ "lstrip": false,
615
+ "normalized": false,
616
+ "rstrip": false,
617
+ "single_word": false,
618
+ "special": true
619
+ },
620
+ "128077": {
621
+ "content": "<|reserved_special_token_69|>",
622
+ "lstrip": false,
623
+ "normalized": false,
624
+ "rstrip": false,
625
+ "single_word": false,
626
+ "special": true
627
+ },
628
+ "128078": {
629
+ "content": "<|reserved_special_token_70|>",
630
+ "lstrip": false,
631
+ "normalized": false,
632
+ "rstrip": false,
633
+ "single_word": false,
634
+ "special": true
635
+ },
636
+ "128079": {
637
+ "content": "<|reserved_special_token_71|>",
638
+ "lstrip": false,
639
+ "normalized": false,
640
+ "rstrip": false,
641
+ "single_word": false,
642
+ "special": true
643
+ },
644
+ "128080": {
645
+ "content": "<|reserved_special_token_72|>",
646
+ "lstrip": false,
647
+ "normalized": false,
648
+ "rstrip": false,
649
+ "single_word": false,
650
+ "special": true
651
+ },
652
+ "128081": {
653
+ "content": "<|reserved_special_token_73|>",
654
+ "lstrip": false,
655
+ "normalized": false,
656
+ "rstrip": false,
657
+ "single_word": false,
658
+ "special": true
659
+ },
660
+ "128082": {
661
+ "content": "<|reserved_special_token_74|>",
662
+ "lstrip": false,
663
+ "normalized": false,
664
+ "rstrip": false,
665
+ "single_word": false,
666
+ "special": true
667
+ },
668
+ "128083": {
669
+ "content": "<|reserved_special_token_75|>",
670
+ "lstrip": false,
671
+ "normalized": false,
672
+ "rstrip": false,
673
+ "single_word": false,
674
+ "special": true
675
+ },
676
+ "128084": {
677
+ "content": "<|reserved_special_token_76|>",
678
+ "lstrip": false,
679
+ "normalized": false,
680
+ "rstrip": false,
681
+ "single_word": false,
682
+ "special": true
683
+ },
684
+ "128085": {
685
+ "content": "<|reserved_special_token_77|>",
686
+ "lstrip": false,
687
+ "normalized": false,
688
+ "rstrip": false,
689
+ "single_word": false,
690
+ "special": true
691
+ },
692
+ "128086": {
693
+ "content": "<|reserved_special_token_78|>",
694
+ "lstrip": false,
695
+ "normalized": false,
696
+ "rstrip": false,
697
+ "single_word": false,
698
+ "special": true
699
+ },
700
+ "128087": {
701
+ "content": "<|reserved_special_token_79|>",
702
+ "lstrip": false,
703
+ "normalized": false,
704
+ "rstrip": false,
705
+ "single_word": false,
706
+ "special": true
707
+ },
708
+ "128088": {
709
+ "content": "<|reserved_special_token_80|>",
710
+ "lstrip": false,
711
+ "normalized": false,
712
+ "rstrip": false,
713
+ "single_word": false,
714
+ "special": true
715
+ },
716
+ "128089": {
717
+ "content": "<|reserved_special_token_81|>",
718
+ "lstrip": false,
719
+ "normalized": false,
720
+ "rstrip": false,
721
+ "single_word": false,
722
+ "special": true
723
+ },
724
+ "128090": {
725
+ "content": "<|reserved_special_token_82|>",
726
+ "lstrip": false,
727
+ "normalized": false,
728
+ "rstrip": false,
729
+ "single_word": false,
730
+ "special": true
731
+ },
732
+ "128091": {
733
+ "content": "<|reserved_special_token_83|>",
734
+ "lstrip": false,
735
+ "normalized": false,
736
+ "rstrip": false,
737
+ "single_word": false,
738
+ "special": true
739
+ },
740
+ "128092": {
741
+ "content": "<|reserved_special_token_84|>",
742
+ "lstrip": false,
743
+ "normalized": false,
744
+ "rstrip": false,
745
+ "single_word": false,
746
+ "special": true
747
+ },
748
+ "128093": {
749
+ "content": "<|reserved_special_token_85|>",
750
+ "lstrip": false,
751
+ "normalized": false,
752
+ "rstrip": false,
753
+ "single_word": false,
754
+ "special": true
755
+ },
756
+ "128094": {
757
+ "content": "<|reserved_special_token_86|>",
758
+ "lstrip": false,
759
+ "normalized": false,
760
+ "rstrip": false,
761
+ "single_word": false,
762
+ "special": true
763
+ },
764
+ "128095": {
765
+ "content": "<|reserved_special_token_87|>",
766
+ "lstrip": false,
767
+ "normalized": false,
768
+ "rstrip": false,
769
+ "single_word": false,
770
+ "special": true
771
+ },
772
+ "128096": {
773
+ "content": "<|reserved_special_token_88|>",
774
+ "lstrip": false,
775
+ "normalized": false,
776
+ "rstrip": false,
777
+ "single_word": false,
778
+ "special": true
779
+ },
780
+ "128097": {
781
+ "content": "<|reserved_special_token_89|>",
782
+ "lstrip": false,
783
+ "normalized": false,
784
+ "rstrip": false,
785
+ "single_word": false,
786
+ "special": true
787
+ },
788
+ "128098": {
789
+ "content": "<|reserved_special_token_90|>",
790
+ "lstrip": false,
791
+ "normalized": false,
792
+ "rstrip": false,
793
+ "single_word": false,
794
+ "special": true
795
+ },
796
+ "128099": {
797
+ "content": "<|reserved_special_token_91|>",
798
+ "lstrip": false,
799
+ "normalized": false,
800
+ "rstrip": false,
801
+ "single_word": false,
802
+ "special": true
803
+ },
804
+ "128100": {
805
+ "content": "<|reserved_special_token_92|>",
806
+ "lstrip": false,
807
+ "normalized": false,
808
+ "rstrip": false,
809
+ "single_word": false,
810
+ "special": true
811
+ },
812
+ "128101": {
813
+ "content": "<|reserved_special_token_93|>",
814
+ "lstrip": false,
815
+ "normalized": false,
816
+ "rstrip": false,
817
+ "single_word": false,
818
+ "special": true
819
+ },
820
+ "128102": {
821
+ "content": "<|reserved_special_token_94|>",
822
+ "lstrip": false,
823
+ "normalized": false,
824
+ "rstrip": false,
825
+ "single_word": false,
826
+ "special": true
827
+ },
828
+ "128103": {
829
+ "content": "<|reserved_special_token_95|>",
830
+ "lstrip": false,
831
+ "normalized": false,
832
+ "rstrip": false,
833
+ "single_word": false,
834
+ "special": true
835
+ },
836
+ "128104": {
837
+ "content": "<|reserved_special_token_96|>",
838
+ "lstrip": false,
839
+ "normalized": false,
840
+ "rstrip": false,
841
+ "single_word": false,
842
+ "special": true
843
+ },
844
+ "128105": {
845
+ "content": "<|reserved_special_token_97|>",
846
+ "lstrip": false,
847
+ "normalized": false,
848
+ "rstrip": false,
849
+ "single_word": false,
850
+ "special": true
851
+ },
852
+ "128106": {
853
+ "content": "<|reserved_special_token_98|>",
854
+ "lstrip": false,
855
+ "normalized": false,
856
+ "rstrip": false,
857
+ "single_word": false,
858
+ "special": true
859
+ },
860
+ "128107": {
861
+ "content": "<|reserved_special_token_99|>",
862
+ "lstrip": false,
863
+ "normalized": false,
864
+ "rstrip": false,
865
+ "single_word": false,
866
+ "special": true
867
+ },
868
+ "128108": {
869
+ "content": "<|reserved_special_token_100|>",
870
+ "lstrip": false,
871
+ "normalized": false,
872
+ "rstrip": false,
873
+ "single_word": false,
874
+ "special": true
875
+ },
876
+ "128109": {
877
+ "content": "<|reserved_special_token_101|>",
878
+ "lstrip": false,
879
+ "normalized": false,
880
+ "rstrip": false,
881
+ "single_word": false,
882
+ "special": true
883
+ },
884
+ "128110": {
885
+ "content": "<|reserved_special_token_102|>",
886
+ "lstrip": false,
887
+ "normalized": false,
888
+ "rstrip": false,
889
+ "single_word": false,
890
+ "special": true
891
+ },
892
+ "128111": {
893
+ "content": "<|reserved_special_token_103|>",
894
+ "lstrip": false,
895
+ "normalized": false,
896
+ "rstrip": false,
897
+ "single_word": false,
898
+ "special": true
899
+ },
900
+ "128112": {
901
+ "content": "<|reserved_special_token_104|>",
902
+ "lstrip": false,
903
+ "normalized": false,
904
+ "rstrip": false,
905
+ "single_word": false,
906
+ "special": true
907
+ },
908
+ "128113": {
909
+ "content": "<|reserved_special_token_105|>",
910
+ "lstrip": false,
911
+ "normalized": false,
912
+ "rstrip": false,
913
+ "single_word": false,
914
+ "special": true
915
+ },
916
+ "128114": {
917
+ "content": "<|reserved_special_token_106|>",
918
+ "lstrip": false,
919
+ "normalized": false,
920
+ "rstrip": false,
921
+ "single_word": false,
922
+ "special": true
923
+ },
924
+ "128115": {
925
+ "content": "<|reserved_special_token_107|>",
926
+ "lstrip": false,
927
+ "normalized": false,
928
+ "rstrip": false,
929
+ "single_word": false,
930
+ "special": true
931
+ },
932
+ "128116": {
933
+ "content": "<|reserved_special_token_108|>",
934
+ "lstrip": false,
935
+ "normalized": false,
936
+ "rstrip": false,
937
+ "single_word": false,
938
+ "special": true
939
+ },
940
+ "128117": {
941
+ "content": "<|reserved_special_token_109|>",
942
+ "lstrip": false,
943
+ "normalized": false,
944
+ "rstrip": false,
945
+ "single_word": false,
946
+ "special": true
947
+ },
948
+ "128118": {
949
+ "content": "<|reserved_special_token_110|>",
950
+ "lstrip": false,
951
+ "normalized": false,
952
+ "rstrip": false,
953
+ "single_word": false,
954
+ "special": true
955
+ },
956
+ "128119": {
957
+ "content": "<|reserved_special_token_111|>",
958
+ "lstrip": false,
959
+ "normalized": false,
960
+ "rstrip": false,
961
+ "single_word": false,
962
+ "special": true
963
+ },
964
+ "128120": {
965
+ "content": "<|reserved_special_token_112|>",
966
+ "lstrip": false,
967
+ "normalized": false,
968
+ "rstrip": false,
969
+ "single_word": false,
970
+ "special": true
971
+ },
972
+ "128121": {
973
+ "content": "<|reserved_special_token_113|>",
974
+ "lstrip": false,
975
+ "normalized": false,
976
+ "rstrip": false,
977
+ "single_word": false,
978
+ "special": true
979
+ },
980
+ "128122": {
981
+ "content": "<|reserved_special_token_114|>",
982
+ "lstrip": false,
983
+ "normalized": false,
984
+ "rstrip": false,
985
+ "single_word": false,
986
+ "special": true
987
+ },
988
+ "128123": {
989
+ "content": "<|reserved_special_token_115|>",
990
+ "lstrip": false,
991
+ "normalized": false,
992
+ "rstrip": false,
993
+ "single_word": false,
994
+ "special": true
995
+ },
996
+ "128124": {
997
+ "content": "<|reserved_special_token_116|>",
998
+ "lstrip": false,
999
+ "normalized": false,
1000
+ "rstrip": false,
1001
+ "single_word": false,
1002
+ "special": true
1003
+ },
1004
+ "128125": {
1005
+ "content": "<|reserved_special_token_117|>",
1006
+ "lstrip": false,
1007
+ "normalized": false,
1008
+ "rstrip": false,
1009
+ "single_word": false,
1010
+ "special": true
1011
+ },
1012
+ "128126": {
1013
+ "content": "<|reserved_special_token_118|>",
1014
+ "lstrip": false,
1015
+ "normalized": false,
1016
+ "rstrip": false,
1017
+ "single_word": false,
1018
+ "special": true
1019
+ },
1020
+ "128127": {
1021
+ "content": "<|reserved_special_token_119|>",
1022
+ "lstrip": false,
1023
+ "normalized": false,
1024
+ "rstrip": false,
1025
+ "single_word": false,
1026
+ "special": true
1027
+ },
1028
+ "128128": {
1029
+ "content": "<|reserved_special_token_120|>",
1030
+ "lstrip": false,
1031
+ "normalized": false,
1032
+ "rstrip": false,
1033
+ "single_word": false,
1034
+ "special": true
1035
+ },
1036
+ "128129": {
1037
+ "content": "<|reserved_special_token_121|>",
1038
+ "lstrip": false,
1039
+ "normalized": false,
1040
+ "rstrip": false,
1041
+ "single_word": false,
1042
+ "special": true
1043
+ },
1044
+ "128130": {
1045
+ "content": "<|reserved_special_token_122|>",
1046
+ "lstrip": false,
1047
+ "normalized": false,
1048
+ "rstrip": false,
1049
+ "single_word": false,
1050
+ "special": true
1051
+ },
1052
+ "128131": {
1053
+ "content": "<|reserved_special_token_123|>",
1054
+ "lstrip": false,
1055
+ "normalized": false,
1056
+ "rstrip": false,
1057
+ "single_word": false,
1058
+ "special": true
1059
+ },
1060
+ "128132": {
1061
+ "content": "<|reserved_special_token_124|>",
1062
+ "lstrip": false,
1063
+ "normalized": false,
1064
+ "rstrip": false,
1065
+ "single_word": false,
1066
+ "special": true
1067
+ },
1068
+ "128133": {
1069
+ "content": "<|reserved_special_token_125|>",
1070
+ "lstrip": false,
1071
+ "normalized": false,
1072
+ "rstrip": false,
1073
+ "single_word": false,
1074
+ "special": true
1075
+ },
1076
+ "128134": {
1077
+ "content": "<|reserved_special_token_126|>",
1078
+ "lstrip": false,
1079
+ "normalized": false,
1080
+ "rstrip": false,
1081
+ "single_word": false,
1082
+ "special": true
1083
+ },
1084
+ "128135": {
1085
+ "content": "<|reserved_special_token_127|>",
1086
+ "lstrip": false,
1087
+ "normalized": false,
1088
+ "rstrip": false,
1089
+ "single_word": false,
1090
+ "special": true
1091
+ },
1092
+ "128136": {
1093
+ "content": "<|reserved_special_token_128|>",
1094
+ "lstrip": false,
1095
+ "normalized": false,
1096
+ "rstrip": false,
1097
+ "single_word": false,
1098
+ "special": true
1099
+ },
1100
+ "128137": {
1101
+ "content": "<|reserved_special_token_129|>",
1102
+ "lstrip": false,
1103
+ "normalized": false,
1104
+ "rstrip": false,
1105
+ "single_word": false,
1106
+ "special": true
1107
+ },
1108
+ "128138": {
1109
+ "content": "<|reserved_special_token_130|>",
1110
+ "lstrip": false,
1111
+ "normalized": false,
1112
+ "rstrip": false,
1113
+ "single_word": false,
1114
+ "special": true
1115
+ },
1116
+ "128139": {
1117
+ "content": "<|reserved_special_token_131|>",
1118
+ "lstrip": false,
1119
+ "normalized": false,
1120
+ "rstrip": false,
1121
+ "single_word": false,
1122
+ "special": true
1123
+ },
1124
+ "128140": {
1125
+ "content": "<|reserved_special_token_132|>",
1126
+ "lstrip": false,
1127
+ "normalized": false,
1128
+ "rstrip": false,
1129
+ "single_word": false,
1130
+ "special": true
1131
+ },
1132
+ "128141": {
1133
+ "content": "<|reserved_special_token_133|>",
1134
+ "lstrip": false,
1135
+ "normalized": false,
1136
+ "rstrip": false,
1137
+ "single_word": false,
1138
+ "special": true
1139
+ },
1140
+ "128142": {
1141
+ "content": "<|reserved_special_token_134|>",
1142
+ "lstrip": false,
1143
+ "normalized": false,
1144
+ "rstrip": false,
1145
+ "single_word": false,
1146
+ "special": true
1147
+ },
1148
+ "128143": {
1149
+ "content": "<|reserved_special_token_135|>",
1150
+ "lstrip": false,
1151
+ "normalized": false,
1152
+ "rstrip": false,
1153
+ "single_word": false,
1154
+ "special": true
1155
+ },
1156
+ "128144": {
1157
+ "content": "<|reserved_special_token_136|>",
1158
+ "lstrip": false,
1159
+ "normalized": false,
1160
+ "rstrip": false,
1161
+ "single_word": false,
1162
+ "special": true
1163
+ },
1164
+ "128145": {
1165
+ "content": "<|reserved_special_token_137|>",
1166
+ "lstrip": false,
1167
+ "normalized": false,
1168
+ "rstrip": false,
1169
+ "single_word": false,
1170
+ "special": true
1171
+ },
1172
+ "128146": {
1173
+ "content": "<|reserved_special_token_138|>",
1174
+ "lstrip": false,
1175
+ "normalized": false,
1176
+ "rstrip": false,
1177
+ "single_word": false,
1178
+ "special": true
1179
+ },
1180
+ "128147": {
1181
+ "content": "<|reserved_special_token_139|>",
1182
+ "lstrip": false,
1183
+ "normalized": false,
1184
+ "rstrip": false,
1185
+ "single_word": false,
1186
+ "special": true
1187
+ },
1188
+ "128148": {
1189
+ "content": "<|reserved_special_token_140|>",
1190
+ "lstrip": false,
1191
+ "normalized": false,
1192
+ "rstrip": false,
1193
+ "single_word": false,
1194
+ "special": true
1195
+ },
1196
+ "128149": {
1197
+ "content": "<|reserved_special_token_141|>",
1198
+ "lstrip": false,
1199
+ "normalized": false,
1200
+ "rstrip": false,
1201
+ "single_word": false,
1202
+ "special": true
1203
+ },
1204
+ "128150": {
1205
+ "content": "<|reserved_special_token_142|>",
1206
+ "lstrip": false,
1207
+ "normalized": false,
1208
+ "rstrip": false,
1209
+ "single_word": false,
1210
+ "special": true
1211
+ },
1212
+ "128151": {
1213
+ "content": "<|reserved_special_token_143|>",
1214
+ "lstrip": false,
1215
+ "normalized": false,
1216
+ "rstrip": false,
1217
+ "single_word": false,
1218
+ "special": true
1219
+ },
1220
+ "128152": {
1221
+ "content": "<|reserved_special_token_144|>",
1222
+ "lstrip": false,
1223
+ "normalized": false,
1224
+ "rstrip": false,
1225
+ "single_word": false,
1226
+ "special": true
1227
+ },
1228
+ "128153": {
1229
+ "content": "<|reserved_special_token_145|>",
1230
+ "lstrip": false,
1231
+ "normalized": false,
1232
+ "rstrip": false,
1233
+ "single_word": false,
1234
+ "special": true
1235
+ },
1236
+ "128154": {
1237
+ "content": "<|reserved_special_token_146|>",
1238
+ "lstrip": false,
1239
+ "normalized": false,
1240
+ "rstrip": false,
1241
+ "single_word": false,
1242
+ "special": true
1243
+ },
1244
+ "128155": {
1245
+ "content": "<|reserved_special_token_147|>",
1246
+ "lstrip": false,
1247
+ "normalized": false,
1248
+ "rstrip": false,
1249
+ "single_word": false,
1250
+ "special": true
1251
+ },
1252
+ "128156": {
1253
+ "content": "<|reserved_special_token_148|>",
1254
+ "lstrip": false,
1255
+ "normalized": false,
1256
+ "rstrip": false,
1257
+ "single_word": false,
1258
+ "special": true
1259
+ },
1260
+ "128157": {
1261
+ "content": "<|reserved_special_token_149|>",
1262
+ "lstrip": false,
1263
+ "normalized": false,
1264
+ "rstrip": false,
1265
+ "single_word": false,
1266
+ "special": true
1267
+ },
1268
+ "128158": {
1269
+ "content": "<|reserved_special_token_150|>",
1270
+ "lstrip": false,
1271
+ "normalized": false,
1272
+ "rstrip": false,
1273
+ "single_word": false,
1274
+ "special": true
1275
+ },
1276
+ "128159": {
1277
+ "content": "<|reserved_special_token_151|>",
1278
+ "lstrip": false,
1279
+ "normalized": false,
1280
+ "rstrip": false,
1281
+ "single_word": false,
1282
+ "special": true
1283
+ },
1284
+ "128160": {
1285
+ "content": "<|reserved_special_token_152|>",
1286
+ "lstrip": false,
1287
+ "normalized": false,
1288
+ "rstrip": false,
1289
+ "single_word": false,
1290
+ "special": true
1291
+ },
1292
+ "128161": {
1293
+ "content": "<|reserved_special_token_153|>",
1294
+ "lstrip": false,
1295
+ "normalized": false,
1296
+ "rstrip": false,
1297
+ "single_word": false,
1298
+ "special": true
1299
+ },
1300
+ "128162": {
1301
+ "content": "<|reserved_special_token_154|>",
1302
+ "lstrip": false,
1303
+ "normalized": false,
1304
+ "rstrip": false,
1305
+ "single_word": false,
1306
+ "special": true
1307
+ },
1308
+ "128163": {
1309
+ "content": "<|reserved_special_token_155|>",
1310
+ "lstrip": false,
1311
+ "normalized": false,
1312
+ "rstrip": false,
1313
+ "single_word": false,
1314
+ "special": true
1315
+ },
1316
+ "128164": {
1317
+ "content": "<|reserved_special_token_156|>",
1318
+ "lstrip": false,
1319
+ "normalized": false,
1320
+ "rstrip": false,
1321
+ "single_word": false,
1322
+ "special": true
1323
+ },
1324
+ "128165": {
1325
+ "content": "<|reserved_special_token_157|>",
1326
+ "lstrip": false,
1327
+ "normalized": false,
1328
+ "rstrip": false,
1329
+ "single_word": false,
1330
+ "special": true
1331
+ },
1332
+ "128166": {
1333
+ "content": "<|reserved_special_token_158|>",
1334
+ "lstrip": false,
1335
+ "normalized": false,
1336
+ "rstrip": false,
1337
+ "single_word": false,
1338
+ "special": true
1339
+ },
1340
+ "128167": {
1341
+ "content": "<|reserved_special_token_159|>",
1342
+ "lstrip": false,
1343
+ "normalized": false,
1344
+ "rstrip": false,
1345
+ "single_word": false,
1346
+ "special": true
1347
+ },
1348
+ "128168": {
1349
+ "content": "<|reserved_special_token_160|>",
1350
+ "lstrip": false,
1351
+ "normalized": false,
1352
+ "rstrip": false,
1353
+ "single_word": false,
1354
+ "special": true
1355
+ },
1356
+ "128169": {
1357
+ "content": "<|reserved_special_token_161|>",
1358
+ "lstrip": false,
1359
+ "normalized": false,
1360
+ "rstrip": false,
1361
+ "single_word": false,
1362
+ "special": true
1363
+ },
1364
+ "128170": {
1365
+ "content": "<|reserved_special_token_162|>",
1366
+ "lstrip": false,
1367
+ "normalized": false,
1368
+ "rstrip": false,
1369
+ "single_word": false,
1370
+ "special": true
1371
+ },
1372
+ "128171": {
1373
+ "content": "<|reserved_special_token_163|>",
1374
+ "lstrip": false,
1375
+ "normalized": false,
1376
+ "rstrip": false,
1377
+ "single_word": false,
1378
+ "special": true
1379
+ },
1380
+ "128172": {
1381
+ "content": "<|reserved_special_token_164|>",
1382
+ "lstrip": false,
1383
+ "normalized": false,
1384
+ "rstrip": false,
1385
+ "single_word": false,
1386
+ "special": true
1387
+ },
1388
+ "128173": {
1389
+ "content": "<|reserved_special_token_165|>",
1390
+ "lstrip": false,
1391
+ "normalized": false,
1392
+ "rstrip": false,
1393
+ "single_word": false,
1394
+ "special": true
1395
+ },
1396
+ "128174": {
1397
+ "content": "<|reserved_special_token_166|>",
1398
+ "lstrip": false,
1399
+ "normalized": false,
1400
+ "rstrip": false,
1401
+ "single_word": false,
1402
+ "special": true
1403
+ },
1404
+ "128175": {
1405
+ "content": "<|reserved_special_token_167|>",
1406
+ "lstrip": false,
1407
+ "normalized": false,
1408
+ "rstrip": false,
1409
+ "single_word": false,
1410
+ "special": true
1411
+ },
1412
+ "128176": {
1413
+ "content": "<|reserved_special_token_168|>",
1414
+ "lstrip": false,
1415
+ "normalized": false,
1416
+ "rstrip": false,
1417
+ "single_word": false,
1418
+ "special": true
1419
+ },
1420
+ "128177": {
1421
+ "content": "<|reserved_special_token_169|>",
1422
+ "lstrip": false,
1423
+ "normalized": false,
1424
+ "rstrip": false,
1425
+ "single_word": false,
1426
+ "special": true
1427
+ },
1428
+ "128178": {
1429
+ "content": "<|reserved_special_token_170|>",
1430
+ "lstrip": false,
1431
+ "normalized": false,
1432
+ "rstrip": false,
1433
+ "single_word": false,
1434
+ "special": true
1435
+ },
1436
+ "128179": {
1437
+ "content": "<|reserved_special_token_171|>",
1438
+ "lstrip": false,
1439
+ "normalized": false,
1440
+ "rstrip": false,
1441
+ "single_word": false,
1442
+ "special": true
1443
+ },
1444
+ "128180": {
1445
+ "content": "<|reserved_special_token_172|>",
1446
+ "lstrip": false,
1447
+ "normalized": false,
1448
+ "rstrip": false,
1449
+ "single_word": false,
1450
+ "special": true
1451
+ },
1452
+ "128181": {
1453
+ "content": "<|reserved_special_token_173|>",
1454
+ "lstrip": false,
1455
+ "normalized": false,
1456
+ "rstrip": false,
1457
+ "single_word": false,
1458
+ "special": true
1459
+ },
1460
+ "128182": {
1461
+ "content": "<|reserved_special_token_174|>",
1462
+ "lstrip": false,
1463
+ "normalized": false,
1464
+ "rstrip": false,
1465
+ "single_word": false,
1466
+ "special": true
1467
+ },
1468
+ "128183": {
1469
+ "content": "<|reserved_special_token_175|>",
1470
+ "lstrip": false,
1471
+ "normalized": false,
1472
+ "rstrip": false,
1473
+ "single_word": false,
1474
+ "special": true
1475
+ },
1476
+ "128184": {
1477
+ "content": "<|reserved_special_token_176|>",
1478
+ "lstrip": false,
1479
+ "normalized": false,
1480
+ "rstrip": false,
1481
+ "single_word": false,
1482
+ "special": true
1483
+ },
1484
+ "128185": {
1485
+ "content": "<|reserved_special_token_177|>",
1486
+ "lstrip": false,
1487
+ "normalized": false,
1488
+ "rstrip": false,
1489
+ "single_word": false,
1490
+ "special": true
1491
+ },
1492
+ "128186": {
1493
+ "content": "<|reserved_special_token_178|>",
1494
+ "lstrip": false,
1495
+ "normalized": false,
1496
+ "rstrip": false,
1497
+ "single_word": false,
1498
+ "special": true
1499
+ },
1500
+ "128187": {
1501
+ "content": "<|reserved_special_token_179|>",
1502
+ "lstrip": false,
1503
+ "normalized": false,
1504
+ "rstrip": false,
1505
+ "single_word": false,
1506
+ "special": true
1507
+ },
1508
+ "128188": {
1509
+ "content": "<|reserved_special_token_180|>",
1510
+ "lstrip": false,
1511
+ "normalized": false,
1512
+ "rstrip": false,
1513
+ "single_word": false,
1514
+ "special": true
1515
+ },
1516
+ "128189": {
1517
+ "content": "<|reserved_special_token_181|>",
1518
+ "lstrip": false,
1519
+ "normalized": false,
1520
+ "rstrip": false,
1521
+ "single_word": false,
1522
+ "special": true
1523
+ },
1524
+ "128190": {
1525
+ "content": "<|reserved_special_token_182|>",
1526
+ "lstrip": false,
1527
+ "normalized": false,
1528
+ "rstrip": false,
1529
+ "single_word": false,
1530
+ "special": true
1531
+ },
1532
+ "128191": {
1533
+ "content": "<|reserved_special_token_183|>",
1534
+ "lstrip": false,
1535
+ "normalized": false,
1536
+ "rstrip": false,
1537
+ "single_word": false,
1538
+ "special": true
1539
+ },
1540
+ "128192": {
1541
+ "content": "<|reserved_special_token_184|>",
1542
+ "lstrip": false,
1543
+ "normalized": false,
1544
+ "rstrip": false,
1545
+ "single_word": false,
1546
+ "special": true
1547
+ },
1548
+ "128193": {
1549
+ "content": "<|reserved_special_token_185|>",
1550
+ "lstrip": false,
1551
+ "normalized": false,
1552
+ "rstrip": false,
1553
+ "single_word": false,
1554
+ "special": true
1555
+ },
1556
+ "128194": {
1557
+ "content": "<|reserved_special_token_186|>",
1558
+ "lstrip": false,
1559
+ "normalized": false,
1560
+ "rstrip": false,
1561
+ "single_word": false,
1562
+ "special": true
1563
+ },
1564
+ "128195": {
1565
+ "content": "<|reserved_special_token_187|>",
1566
+ "lstrip": false,
1567
+ "normalized": false,
1568
+ "rstrip": false,
1569
+ "single_word": false,
1570
+ "special": true
1571
+ },
1572
+ "128196": {
1573
+ "content": "<|reserved_special_token_188|>",
1574
+ "lstrip": false,
1575
+ "normalized": false,
1576
+ "rstrip": false,
1577
+ "single_word": false,
1578
+ "special": true
1579
+ },
1580
+ "128197": {
1581
+ "content": "<|reserved_special_token_189|>",
1582
+ "lstrip": false,
1583
+ "normalized": false,
1584
+ "rstrip": false,
1585
+ "single_word": false,
1586
+ "special": true
1587
+ },
1588
+ "128198": {
1589
+ "content": "<|reserved_special_token_190|>",
1590
+ "lstrip": false,
1591
+ "normalized": false,
1592
+ "rstrip": false,
1593
+ "single_word": false,
1594
+ "special": true
1595
+ },
1596
+ "128199": {
1597
+ "content": "<|reserved_special_token_191|>",
1598
+ "lstrip": false,
1599
+ "normalized": false,
1600
+ "rstrip": false,
1601
+ "single_word": false,
1602
+ "special": true
1603
+ },
1604
+ "128200": {
1605
+ "content": "<|reserved_special_token_192|>",
1606
+ "lstrip": false,
1607
+ "normalized": false,
1608
+ "rstrip": false,
1609
+ "single_word": false,
1610
+ "special": true
1611
+ },
1612
+ "128201": {
1613
+ "content": "<|reserved_special_token_193|>",
1614
+ "lstrip": false,
1615
+ "normalized": false,
1616
+ "rstrip": false,
1617
+ "single_word": false,
1618
+ "special": true
1619
+ },
1620
+ "128202": {
1621
+ "content": "<|reserved_special_token_194|>",
1622
+ "lstrip": false,
1623
+ "normalized": false,
1624
+ "rstrip": false,
1625
+ "single_word": false,
1626
+ "special": true
1627
+ },
1628
+ "128203": {
1629
+ "content": "<|reserved_special_token_195|>",
1630
+ "lstrip": false,
1631
+ "normalized": false,
1632
+ "rstrip": false,
1633
+ "single_word": false,
1634
+ "special": true
1635
+ },
1636
+ "128204": {
1637
+ "content": "<|reserved_special_token_196|>",
1638
+ "lstrip": false,
1639
+ "normalized": false,
1640
+ "rstrip": false,
1641
+ "single_word": false,
1642
+ "special": true
1643
+ },
1644
+ "128205": {
1645
+ "content": "<|reserved_special_token_197|>",
1646
+ "lstrip": false,
1647
+ "normalized": false,
1648
+ "rstrip": false,
1649
+ "single_word": false,
1650
+ "special": true
1651
+ },
1652
+ "128206": {
1653
+ "content": "<|reserved_special_token_198|>",
1654
+ "lstrip": false,
1655
+ "normalized": false,
1656
+ "rstrip": false,
1657
+ "single_word": false,
1658
+ "special": true
1659
+ },
1660
+ "128207": {
1661
+ "content": "<|reserved_special_token_199|>",
1662
+ "lstrip": false,
1663
+ "normalized": false,
1664
+ "rstrip": false,
1665
+ "single_word": false,
1666
+ "special": true
1667
+ },
1668
+ "128208": {
1669
+ "content": "<|reserved_special_token_200|>",
1670
+ "lstrip": false,
1671
+ "normalized": false,
1672
+ "rstrip": false,
1673
+ "single_word": false,
1674
+ "special": true
1675
+ },
1676
+ "128209": {
1677
+ "content": "<|reserved_special_token_201|>",
1678
+ "lstrip": false,
1679
+ "normalized": false,
1680
+ "rstrip": false,
1681
+ "single_word": false,
1682
+ "special": true
1683
+ },
1684
+ "128210": {
1685
+ "content": "<|reserved_special_token_202|>",
1686
+ "lstrip": false,
1687
+ "normalized": false,
1688
+ "rstrip": false,
1689
+ "single_word": false,
1690
+ "special": true
1691
+ },
1692
+ "128211": {
1693
+ "content": "<|reserved_special_token_203|>",
1694
+ "lstrip": false,
1695
+ "normalized": false,
1696
+ "rstrip": false,
1697
+ "single_word": false,
1698
+ "special": true
1699
+ },
1700
+ "128212": {
1701
+ "content": "<|reserved_special_token_204|>",
1702
+ "lstrip": false,
1703
+ "normalized": false,
1704
+ "rstrip": false,
1705
+ "single_word": false,
1706
+ "special": true
1707
+ },
1708
+ "128213": {
1709
+ "content": "<|reserved_special_token_205|>",
1710
+ "lstrip": false,
1711
+ "normalized": false,
1712
+ "rstrip": false,
1713
+ "single_word": false,
1714
+ "special": true
1715
+ },
1716
+ "128214": {
1717
+ "content": "<|reserved_special_token_206|>",
1718
+ "lstrip": false,
1719
+ "normalized": false,
1720
+ "rstrip": false,
1721
+ "single_word": false,
1722
+ "special": true
1723
+ },
1724
+ "128215": {
1725
+ "content": "<|reserved_special_token_207|>",
1726
+ "lstrip": false,
1727
+ "normalized": false,
1728
+ "rstrip": false,
1729
+ "single_word": false,
1730
+ "special": true
1731
+ },
1732
+ "128216": {
1733
+ "content": "<|reserved_special_token_208|>",
1734
+ "lstrip": false,
1735
+ "normalized": false,
1736
+ "rstrip": false,
1737
+ "single_word": false,
1738
+ "special": true
1739
+ },
1740
+ "128217": {
1741
+ "content": "<|reserved_special_token_209|>",
1742
+ "lstrip": false,
1743
+ "normalized": false,
1744
+ "rstrip": false,
1745
+ "single_word": false,
1746
+ "special": true
1747
+ },
1748
+ "128218": {
1749
+ "content": "<|reserved_special_token_210|>",
1750
+ "lstrip": false,
1751
+ "normalized": false,
1752
+ "rstrip": false,
1753
+ "single_word": false,
1754
+ "special": true
1755
+ },
1756
+ "128219": {
1757
+ "content": "<|reserved_special_token_211|>",
1758
+ "lstrip": false,
1759
+ "normalized": false,
1760
+ "rstrip": false,
1761
+ "single_word": false,
1762
+ "special": true
1763
+ },
1764
+ "128220": {
1765
+ "content": "<|reserved_special_token_212|>",
1766
+ "lstrip": false,
1767
+ "normalized": false,
1768
+ "rstrip": false,
1769
+ "single_word": false,
1770
+ "special": true
1771
+ },
1772
+ "128221": {
1773
+ "content": "<|reserved_special_token_213|>",
1774
+ "lstrip": false,
1775
+ "normalized": false,
1776
+ "rstrip": false,
1777
+ "single_word": false,
1778
+ "special": true
1779
+ },
1780
+ "128222": {
1781
+ "content": "<|reserved_special_token_214|>",
1782
+ "lstrip": false,
1783
+ "normalized": false,
1784
+ "rstrip": false,
1785
+ "single_word": false,
1786
+ "special": true
1787
+ },
1788
+ "128223": {
1789
+ "content": "<|reserved_special_token_215|>",
1790
+ "lstrip": false,
1791
+ "normalized": false,
1792
+ "rstrip": false,
1793
+ "single_word": false,
1794
+ "special": true
1795
+ },
1796
+ "128224": {
1797
+ "content": "<|reserved_special_token_216|>",
1798
+ "lstrip": false,
1799
+ "normalized": false,
1800
+ "rstrip": false,
1801
+ "single_word": false,
1802
+ "special": true
1803
+ },
1804
+ "128225": {
1805
+ "content": "<|reserved_special_token_217|>",
1806
+ "lstrip": false,
1807
+ "normalized": false,
1808
+ "rstrip": false,
1809
+ "single_word": false,
1810
+ "special": true
1811
+ },
1812
+ "128226": {
1813
+ "content": "<|reserved_special_token_218|>",
1814
+ "lstrip": false,
1815
+ "normalized": false,
1816
+ "rstrip": false,
1817
+ "single_word": false,
1818
+ "special": true
1819
+ },
1820
+ "128227": {
1821
+ "content": "<|reserved_special_token_219|>",
1822
+ "lstrip": false,
1823
+ "normalized": false,
1824
+ "rstrip": false,
1825
+ "single_word": false,
1826
+ "special": true
1827
+ },
1828
+ "128228": {
1829
+ "content": "<|reserved_special_token_220|>",
1830
+ "lstrip": false,
1831
+ "normalized": false,
1832
+ "rstrip": false,
1833
+ "single_word": false,
1834
+ "special": true
1835
+ },
1836
+ "128229": {
1837
+ "content": "<|reserved_special_token_221|>",
1838
+ "lstrip": false,
1839
+ "normalized": false,
1840
+ "rstrip": false,
1841
+ "single_word": false,
1842
+ "special": true
1843
+ },
1844
+ "128230": {
1845
+ "content": "<|reserved_special_token_222|>",
1846
+ "lstrip": false,
1847
+ "normalized": false,
1848
+ "rstrip": false,
1849
+ "single_word": false,
1850
+ "special": true
1851
+ },
1852
+ "128231": {
1853
+ "content": "<|reserved_special_token_223|>",
1854
+ "lstrip": false,
1855
+ "normalized": false,
1856
+ "rstrip": false,
1857
+ "single_word": false,
1858
+ "special": true
1859
+ },
1860
+ "128232": {
1861
+ "content": "<|reserved_special_token_224|>",
1862
+ "lstrip": false,
1863
+ "normalized": false,
1864
+ "rstrip": false,
1865
+ "single_word": false,
1866
+ "special": true
1867
+ },
1868
+ "128233": {
1869
+ "content": "<|reserved_special_token_225|>",
1870
+ "lstrip": false,
1871
+ "normalized": false,
1872
+ "rstrip": false,
1873
+ "single_word": false,
1874
+ "special": true
1875
+ },
1876
+ "128234": {
1877
+ "content": "<|reserved_special_token_226|>",
1878
+ "lstrip": false,
1879
+ "normalized": false,
1880
+ "rstrip": false,
1881
+ "single_word": false,
1882
+ "special": true
1883
+ },
1884
+ "128235": {
1885
+ "content": "<|reserved_special_token_227|>",
1886
+ "lstrip": false,
1887
+ "normalized": false,
1888
+ "rstrip": false,
1889
+ "single_word": false,
1890
+ "special": true
1891
+ },
1892
+ "128236": {
1893
+ "content": "<|reserved_special_token_228|>",
1894
+ "lstrip": false,
1895
+ "normalized": false,
1896
+ "rstrip": false,
1897
+ "single_word": false,
1898
+ "special": true
1899
+ },
1900
+ "128237": {
1901
+ "content": "<|reserved_special_token_229|>",
1902
+ "lstrip": false,
1903
+ "normalized": false,
1904
+ "rstrip": false,
1905
+ "single_word": false,
1906
+ "special": true
1907
+ },
1908
+ "128238": {
1909
+ "content": "<|reserved_special_token_230|>",
1910
+ "lstrip": false,
1911
+ "normalized": false,
1912
+ "rstrip": false,
1913
+ "single_word": false,
1914
+ "special": true
1915
+ },
1916
+ "128239": {
1917
+ "content": "<|reserved_special_token_231|>",
1918
+ "lstrip": false,
1919
+ "normalized": false,
1920
+ "rstrip": false,
1921
+ "single_word": false,
1922
+ "special": true
1923
+ },
1924
+ "128240": {
1925
+ "content": "<|reserved_special_token_232|>",
1926
+ "lstrip": false,
1927
+ "normalized": false,
1928
+ "rstrip": false,
1929
+ "single_word": false,
1930
+ "special": true
1931
+ },
1932
+ "128241": {
1933
+ "content": "<|reserved_special_token_233|>",
1934
+ "lstrip": false,
1935
+ "normalized": false,
1936
+ "rstrip": false,
1937
+ "single_word": false,
1938
+ "special": true
1939
+ },
1940
+ "128242": {
1941
+ "content": "<|reserved_special_token_234|>",
1942
+ "lstrip": false,
1943
+ "normalized": false,
1944
+ "rstrip": false,
1945
+ "single_word": false,
1946
+ "special": true
1947
+ },
1948
+ "128243": {
1949
+ "content": "<|reserved_special_token_235|>",
1950
+ "lstrip": false,
1951
+ "normalized": false,
1952
+ "rstrip": false,
1953
+ "single_word": false,
1954
+ "special": true
1955
+ },
1956
+ "128244": {
1957
+ "content": "<|reserved_special_token_236|>",
1958
+ "lstrip": false,
1959
+ "normalized": false,
1960
+ "rstrip": false,
1961
+ "single_word": false,
1962
+ "special": true
1963
+ },
1964
+ "128245": {
1965
+ "content": "<|reserved_special_token_237|>",
1966
+ "lstrip": false,
1967
+ "normalized": false,
1968
+ "rstrip": false,
1969
+ "single_word": false,
1970
+ "special": true
1971
+ },
1972
+ "128246": {
1973
+ "content": "<|reserved_special_token_238|>",
1974
+ "lstrip": false,
1975
+ "normalized": false,
1976
+ "rstrip": false,
1977
+ "single_word": false,
1978
+ "special": true
1979
+ },
1980
+ "128247": {
1981
+ "content": "<|reserved_special_token_239|>",
1982
+ "lstrip": false,
1983
+ "normalized": false,
1984
+ "rstrip": false,
1985
+ "single_word": false,
1986
+ "special": true
1987
+ },
1988
+ "128248": {
1989
+ "content": "<|reserved_special_token_240|>",
1990
+ "lstrip": false,
1991
+ "normalized": false,
1992
+ "rstrip": false,
1993
+ "single_word": false,
1994
+ "special": true
1995
+ },
1996
+ "128249": {
1997
+ "content": "<|reserved_special_token_241|>",
1998
+ "lstrip": false,
1999
+ "normalized": false,
2000
+ "rstrip": false,
2001
+ "single_word": false,
2002
+ "special": true
2003
+ },
2004
+ "128250": {
2005
+ "content": "<|reserved_special_token_242|>",
2006
+ "lstrip": false,
2007
+ "normalized": false,
2008
+ "rstrip": false,
2009
+ "single_word": false,
2010
+ "special": true
2011
+ },
2012
+ "128251": {
2013
+ "content": "<|reserved_special_token_243|>",
2014
+ "lstrip": false,
2015
+ "normalized": false,
2016
+ "rstrip": false,
2017
+ "single_word": false,
2018
+ "special": true
2019
+ },
2020
+ "128252": {
2021
+ "content": "<|reserved_special_token_244|>",
2022
+ "lstrip": false,
2023
+ "normalized": false,
2024
+ "rstrip": false,
2025
+ "single_word": false,
2026
+ "special": true
2027
+ },
2028
+ "128253": {
2029
+ "content": "<|reserved_special_token_245|>",
2030
+ "lstrip": false,
2031
+ "normalized": false,
2032
+ "rstrip": false,
2033
+ "single_word": false,
2034
+ "special": true
2035
+ },
2036
+ "128254": {
2037
+ "content": "<|reserved_special_token_246|>",
2038
+ "lstrip": false,
2039
+ "normalized": false,
2040
+ "rstrip": false,
2041
+ "single_word": false,
2042
+ "special": true
2043
+ },
2044
+ "128255": {
2045
+ "content": "<|reserved_special_token_247|>",
2046
+ "lstrip": false,
2047
+ "normalized": false,
2048
+ "rstrip": false,
2049
+ "single_word": false,
2050
+ "special": true
2051
+ }
2052
+ },
2053
+ "bos_token": "<|begin_of_text|>",
2054
+ "clean_up_tokenization_spaces": true,
2055
+ "eos_token": "<|eot_id|>",
2056
+ "extra_special_tokens": {},
2057
+ "model_input_names": [
2058
+ "input_ids",
2059
+ "attention_mask"
2060
+ ],
2061
+ "model_max_length": 131072,
2062
+ "pad_token": "<|finetune_right_pad_id|>",
2063
+ "padding_side": "left",
2064
+ "tokenizer_class": "PreTrainedTokenizerFast",
2065
+ "unk_token": null
2066
+ }