soldni commited on
Commit
833d118
·
verified ·
1 Parent(s): fe0ce1a

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+
6
+ # Dolma 2 tokenizer, Instruct v2, reasoner version
7
+
8
+ Slightly modified version of `cl100k_base` that supports Dolma 1.x and Dolma 2.x special tokens.
9
+
10
+ ## Special tokens
11
+
12
+ This tokenizer supports the following special tokens:
13
+
14
+ - `<|extra_id_0|>`: Not used.
15
+ - `<|endoftext|>`: Used to mark both beginning and end of text.
16
+ - `<|fim_prefix|>`: Used to mark the prefix fill-in-the-middle request.
17
+ - `<|fim_middle|>`: Used to mark the middle fill-in-the-middle request.
18
+ - `<|fim_suffix|>`: Used to mark the suffix fill-in-the-middle request.
19
+ - `|||PHONE_NUMBER|||`: Not used. Kept for compatibility with Dolma 1.x.
20
+ - `|||EMAIL_ADDRESS|||`: Not used. Kept for compatibility with Dolma 1.x.
21
+ - `|||IP_ADDRESS|||`: Not used. Kept for compatibility with Dolma 1.x.
22
+ - `<|im_start|>`: Indicates the beginning of a message (turn in a conversation).
23
+ - `<|im_end|>`: Indicates the end of a message (turn in a conversation).
24
+ - `<|extra_id_1|>`: Not used.
25
+ - `<|extra_id_2|>`: Not used.
26
+ - `<|extra_id_3|>`: Not used.
27
+ - `<|extra_id_4|>`: Not used.
28
+ - `<|extra_id_5|>`: Not used.
29
+ - `<|extra_id_6|>`: Not used.
30
+ - `<|extra_id_7|>`: Not used.
31
+ - `<|extra_id_8|>`: Not used.
32
+ - `<|extra_id_9|>`: Not used.
33
+ - `<|extra_id_10|>`: Not used.
34
+ - `<|endofprompt|>`: Not Used.
35
+ - `<|pad|>`: Symbol to pad input sequences.
36
+
37
+
38
+ ## Chat template
39
+
40
+ The chat template is as follows (**for reference only**, actual template is in `tokenizer_config.json`):
41
+
42
+ ```jinja
43
+ {% set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 %}
44
+ {% if not has_system %}
45
+ {{ '<|im_start|>system
46
+ You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>
47
+ ' }}
48
+ {% endif %}
49
+ {% for message in messages %}
50
+ {% if message['role'] == 'system' %}
51
+ {{ '<|im_start|>system
52
+ ' + message['content'] }}
53
+ {% if message.get('functions', none) is not none %}
54
+ {{ ' <functions>' + message['functions'] + '</functions><|im_end|>
55
+ ' }}
56
+ {% else %}
57
+ {{ ' You do not currently have access to any functions. <functions></functions><|im_end|>
58
+ ' }}
59
+ {% endif %}
60
+ {% elif message['role'] == 'user' %}
61
+ {% if message.get('functions', none) is not none %}
62
+ {{ '<|im_start|>user
63
+ ' + message['content'] + '
64
+ ' + '<functions>' + message['functions'] + '</functions><|im_end|>
65
+ ' }}
66
+ {% else %}
67
+ {{ '<|im_start|>user
68
+ ' + message['content'] + '<|im_end|>
69
+ ' }}
70
+ {% endif %}
71
+ {% elif message['role'] == 'assistant' %}
72
+ {{ '<|im_start|>assistant
73
+ ' }}
74
+ {% if message.get('content', none) is not none %}
75
+ {{ message['content'] }}
76
+ {% endif %}
77
+ {% if message.get('function_calls', none) is not none %}
78
+ {{ '<function_calls>' + message['function_calls'] + '</function_calls>' }}
79
+ {% endif %}
80
+ {% if not loop.last %}
81
+ {{ '<|im_end|>' + '
82
+ ' }}
83
+ {% else %}
84
+ {{ eos_token }}
85
+ {% endif %}
86
+ {% elif message['role'] == 'environment' %}
87
+ {{ '<|im_start|>environment
88
+ ' + message['content'] + '<|im_end|>
89
+ ' }}
90
+ {% endif %}
91
+ {% if loop.last and add_generation_prompt %}
92
+ {{ '<|im_start|>assistant
93
+ <think>' }}
94
+ {% endif %}
95
+ {% endfor %}
96
+ ```
config.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Olmo3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "eos_token_id": 100257,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 4096,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 11008,
12
+ "layer_types": [
13
+ "sliding_attention",
14
+ "sliding_attention",
15
+ "sliding_attention",
16
+ "full_attention",
17
+ "sliding_attention",
18
+ "sliding_attention",
19
+ "sliding_attention",
20
+ "full_attention",
21
+ "sliding_attention",
22
+ "sliding_attention",
23
+ "sliding_attention",
24
+ "full_attention",
25
+ "sliding_attention",
26
+ "sliding_attention",
27
+ "sliding_attention",
28
+ "full_attention",
29
+ "sliding_attention",
30
+ "sliding_attention",
31
+ "sliding_attention",
32
+ "full_attention",
33
+ "sliding_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "full_attention",
41
+ "sliding_attention",
42
+ "sliding_attention",
43
+ "sliding_attention",
44
+ "full_attention"
45
+ ],
46
+ "max_position_embeddings": 65536,
47
+ "model_type": "olmo3",
48
+ "num_attention_heads": 32,
49
+ "num_hidden_layers": 32,
50
+ "num_key_value_heads": 32,
51
+ "pad_token_id": 100277,
52
+ "rms_norm_eps": 1e-06,
53
+ "rope_scaling": {
54
+ "attention_factor": 1.2079441541679836,
55
+ "beta_fast": 32,
56
+ "beta_slow": 1,
57
+ "factor": 8.0,
58
+ "original_max_position_embeddings": 8192,
59
+ "rope_type": "yarn"
60
+ },
61
+ "rope_theta": 500000,
62
+ "sliding_window": 4096,
63
+ "tie_word_embeddings": false,
64
+ "torch_dtype": "bfloat16",
65
+ "transformers_version": "4.54.0.dev0",
66
+ "use_cache": true,
67
+ "vocab_size": 100278
68
+ }
fix_tokens.py ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env -S uv run --script
2
+ # /// script
3
+ # requires-python = ">=3.11"
4
+ # dependencies = [
5
+ # "click",
6
+ # ]
7
+ # ///
8
+
9
+ from dataclasses import dataclass, asdict, field
10
+ from enum import Enum
11
+ from pathlib import Path
12
+ import click
13
+ import json
14
+
15
+
16
+ class SpecialTokensMapEnum(Enum):
17
+ BOS_TOKEN = "bos_token"
18
+ EOS_TOKEN = "eos_token"
19
+ PAD_TOKEN = "pad_token"
20
+ UNK_TOKEN = "unk_token"
21
+
22
+
23
+
24
+ @dataclass(frozen=True)
25
+ class SpecialToken:
26
+ id: int
27
+ content: str
28
+ lstrip: bool = False
29
+ normalized: bool = False
30
+ rstrip: bool = False
31
+ single_word: bool = False
32
+ special: bool = False
33
+ special_token_map: list[SpecialTokensMapEnum] = field(default_factory=list)
34
+
35
+ def to_added_tokens_decoder(self):
36
+ data = asdict(self)
37
+ token_id = str(data.pop("id"))
38
+ data.pop("special_token_map")
39
+ return {token_id: data}
40
+
41
+ def to_added_tokens(self):
42
+ data = asdict(self)
43
+ data.pop("special_token_map")
44
+ return data
45
+
46
+ def to_special_tokens_map(self) -> dict[str, dict]:
47
+ special_tokens_map = {}
48
+ for special_token_map in self.special_token_map:
49
+ data = asdict(self)
50
+ data.pop("special_token_map")
51
+ data.pop("special")
52
+ data.pop("id")
53
+ special_tokens_map[special_token_map.value] = data
54
+
55
+ return special_tokens_map
56
+
57
+
58
+ MODEL_MAX_LENGTH = 65536
59
+
60
+ DESIRED_MAPPING = [
61
+ SpecialToken(id=100256, content="<|extra_id_0|>"),
62
+ SpecialToken(
63
+ id=100257,
64
+ content="<|endoftext|>",
65
+ special=True,
66
+ special_token_map=[
67
+ SpecialTokensMapEnum.BOS_TOKEN,
68
+ SpecialTokensMapEnum.EOS_TOKEN,
69
+ SpecialTokensMapEnum.UNK_TOKEN,
70
+ ]),
71
+ SpecialToken(id=100258, content="<|fim_prefix|>", special=True),
72
+ SpecialToken(id=100259, content="<|fim_middle|>", special=True),
73
+ SpecialToken(id=100260, content="<|fim_suffix|>",special=True),
74
+ SpecialToken(id=100261, content="|||PHONE_NUMBER|||"),
75
+ SpecialToken(id=100262, content="|||EMAIL_ADDRESS|||"),
76
+ SpecialToken(id=100263, content="|||IP_ADDRESS|||"),
77
+ SpecialToken(id=100264, content="<|im_start|>", special=True),
78
+ SpecialToken(id=100265, content="<|im_end|>", special=True),
79
+ SpecialToken(id=100266, content="<|extra_id_1|>"),
80
+ SpecialToken(id=100267, content="<|extra_id_2|>"),
81
+ SpecialToken(id=100268, content="<|extra_id_3|>"),
82
+ SpecialToken(id=100269, content="<|extra_id_4|>"),
83
+ SpecialToken(id=100270, content="<|extra_id_5|>"),
84
+ SpecialToken(id=100271, content="<|extra_id_6|>"),
85
+ SpecialToken(id=100272, content="<|extra_id_7|>"),
86
+ SpecialToken(id=100273, content="<|extra_id_8|>"),
87
+ SpecialToken(id=100274, content="<|extra_id_9|>"),
88
+ SpecialToken(id=100275, content="<|extra_id_10|>"),
89
+ SpecialToken(id=100276, content="<|endofprompt|>", special=True),
90
+ SpecialToken(
91
+ id=100277,
92
+ content="<|pad|>",
93
+ special=True,
94
+ special_token_map=[SpecialTokensMapEnum.PAD_TOKEN],
95
+ ),
96
+ ]
97
+
98
+ SCRIPT_DIR = Path(__file__).parent
99
+ TOKENIZER_CONFIG_FILE = SCRIPT_DIR / "tokenizer_config.json"
100
+ TOKENIZER_FILE = SCRIPT_DIR / "tokenizer.json"
101
+ VOCAB_FILE = SCRIPT_DIR / "vocab.json"
102
+ SPECIAL_TOKENS_MAP_FILE = SCRIPT_DIR / "special_tokens_map.json"
103
+
104
+
105
+
106
+ @click.group()
107
+ def cli():
108
+ """Dataset processing tools."""
109
+ pass
110
+
111
+
112
+
113
+ def _get_mapped_special_token(
114
+ special_tokens: list[SpecialToken],
115
+ mapped_token: SpecialTokensMapEnum
116
+ ) -> SpecialToken:
117
+ all_mapped_tokens = [token for token in special_tokens if mapped_token in token.special_token_map]
118
+ if len(all_mapped_tokens) == 0:
119
+ raise ValueError(f"Cannot find mapped token for {mapped_token}")
120
+ if len(all_mapped_tokens) > 1:
121
+ all_mapped_tokens_str = ", ".join([token.content for token in all_mapped_tokens])
122
+ raise ValueError(f"Found multiple mapped tokens for {mapped_token}: {all_mapped_tokens_str}")
123
+ return all_mapped_tokens[0]
124
+
125
+
126
+ def get_unk_token(special_tokens: list[SpecialToken]) -> SpecialToken:
127
+ return _get_mapped_special_token(special_tokens, SpecialTokensMapEnum.UNK_TOKEN)
128
+
129
+
130
+ def get_bos_token(special_tokens: list[SpecialToken]) -> SpecialToken:
131
+ return _get_mapped_special_token(special_tokens, SpecialTokensMapEnum.BOS_TOKEN)
132
+
133
+
134
+ def get_eos_token(special_tokens: list[SpecialToken]) -> SpecialToken:
135
+ return _get_mapped_special_token(special_tokens, SpecialTokensMapEnum.EOS_TOKEN)
136
+
137
+
138
+ def get_pad_token(special_tokens: list[SpecialToken]) -> SpecialToken:
139
+ return _get_mapped_special_token(special_tokens, SpecialTokensMapEnum.PAD_TOKEN)
140
+
141
+
142
+ @cli.command()
143
+ def check():
144
+ """Check if the current config matches the desired mapping."""
145
+
146
+ # STEP 1: Check the Tokenizer Config File #
147
+ print("STEP 1: Checking tokenizer config file...")
148
+
149
+ if not TOKENIZER_CONFIG_FILE.exists():
150
+ raise FileNotFoundError(f"Tokenizer config file not found: {TOKENIZER_CONFIG_FILE}")
151
+
152
+ with open(TOKENIZER_CONFIG_FILE, "r") as f:
153
+ tokenizer_config = json.load(f)
154
+
155
+ added_tokens_decoder = tokenizer_config.get("added_tokens_decoder", {})
156
+ for token in DESIRED_MAPPING:
157
+ str_token_id = str(token.id)
158
+ if str_token_id not in added_tokens_decoder:
159
+ raise ValueError(f"Token {token.id} not found in added tokens decoder")
160
+
161
+ computed_added_tokens_decoder = token.to_added_tokens_decoder()
162
+ if computed_added_tokens_decoder[str_token_id] != added_tokens_decoder[str_token_id]:
163
+ raise ValueError(f"Token {token.id} has different content in added tokens decoder")
164
+
165
+ print(f"Token {token.id} found in added tokens decoder; content matches")
166
+
167
+ bos_token = get_bos_token(DESIRED_MAPPING)
168
+ if bos_token.content != tokenizer_config["bos_token"]:
169
+ raise ValueError(f"Bos token content mismatch: {bos_token.content} != {tokenizer_config['bos_token']}")
170
+ else:
171
+ print("Bos token content matches")
172
+
173
+ eos_token = get_eos_token(DESIRED_MAPPING)
174
+ if eos_token.content != tokenizer_config["eos_token"]:
175
+ raise ValueError(f"Eos token content mismatch: {eos_token.content} != {tokenizer_config['eos_token']}")
176
+ else:
177
+ print("Eos token content matches")
178
+
179
+ pad_token = get_pad_token(DESIRED_MAPPING)
180
+ if pad_token.content != tokenizer_config["pad_token"]:
181
+ raise ValueError(f"Pad token content mismatch: {pad_token.content} != {tokenizer_config['pad_token']}")
182
+ else:
183
+ print("Pad token content matches")
184
+
185
+ unk_token = get_unk_token(DESIRED_MAPPING)
186
+ if unk_token.content != tokenizer_config["unk_token"]:
187
+ raise ValueError(f"Unk token content mismatch: {unk_token.content} != {tokenizer_config['unk_token']}")
188
+ else:
189
+ print("Unk token content matches")
190
+
191
+ if tokenizer_config["model_max_length"] != MODEL_MAX_LENGTH:
192
+ raise ValueError(f"Model max length mismatch: {tokenizer_config['model_max_length']} != {MODEL_MAX_LENGTH}")
193
+ else:
194
+ print("Model max length matches")
195
+
196
+
197
+ # STEP 2: Check the Tokenizer File #
198
+ print("STEP 2: Checking tokenizer file...")
199
+
200
+ if not TOKENIZER_FILE.exists():
201
+ raise FileNotFoundError(f"Tokenizer file not found: {TOKENIZER_FILE}")
202
+
203
+ with open(TOKENIZER_FILE, "r") as f:
204
+ tokenizer = json.load(f)
205
+
206
+ # check if added_tokens matches
207
+ added_tokens_dict = {token["id"]: token for token in tokenizer.get("added_tokens", [])}
208
+ for token in DESIRED_MAPPING:
209
+ if token.id not in added_tokens_dict:
210
+ raise ValueError(f"Token {token.id} not found in added tokens")
211
+
212
+ computed_added_token = token.to_added_tokens()
213
+ if computed_added_token != added_tokens_dict[token.id]:
214
+ raise ValueError(f"Token {token.id} has different content in added tokens")
215
+ print(f"Token {token.id} found in added tokens; content matches.")
216
+
217
+ # check vocab
218
+ vocab = tokenizer.get("model", {}).get("vocab", {})
219
+ for token in DESIRED_MAPPING:
220
+ if token.content not in vocab:
221
+ raise ValueError(f"Token `{token.content}` not found in vocab")
222
+ if token.id != vocab[token.content]:
223
+ raise ValueError(f"Token `{token.content}`: vocab=`{vocab[token.content]}` provided=`{token.id}`")
224
+ print(f"Token `{token.content}` found in vocab; id `{token.id}` matches.")
225
+
226
+ seen_values: dict[int, list[str]] = {}
227
+ for key, value in vocab.items():
228
+ seen_values.setdefault(value, []).append(key)
229
+
230
+ broken_vocab = False
231
+ for value, keys in seen_values.items():
232
+ if len(keys) > 1:
233
+ broken_vocab = True
234
+ print(f"Vocab value {value} is not unique; keys: {keys}")
235
+
236
+ if broken_vocab:
237
+ raise ValueError("Vocab values are not unique")
238
+
239
+ else:
240
+ print("Vocab values are unique")
241
+
242
+ # STEP 3: Check the Vocab File #
243
+ print("STEP 3: Checking vocab file...")
244
+
245
+ if not VOCAB_FILE.exists():
246
+ raise FileNotFoundError(f"Vocab file not found: {VOCAB_FILE}")
247
+
248
+ with open(VOCAB_FILE, "r") as f:
249
+ vocab = json.load(f)
250
+
251
+ for token in DESIRED_MAPPING:
252
+ if token.content not in vocab:
253
+ raise ValueError(f"Token `{token.content}` not found in vocab")
254
+ if token.id != vocab[token.content]:
255
+ raise ValueError(f"Token `{token.content}`: vocab=`{vocab[token.content]}` provided=`{token.id}`")
256
+ print(f"Token `{token.content}` found in vocab; id `{token.id}` matches.")
257
+
258
+ if len(set(vocab.values())) != len(vocab):
259
+ raise ValueError("Vocab values are not unique")
260
+
261
+ # STEP 4: Check the Special Tokens Map File #
262
+ print("STEP 4: Checking special tokens map file...")
263
+
264
+ if not SPECIAL_TOKENS_MAP_FILE.exists():
265
+ raise FileNotFoundError(f"Special tokens map file not found: {SPECIAL_TOKENS_MAP_FILE}")
266
+
267
+ with open(SPECIAL_TOKENS_MAP_FILE, "r") as f:
268
+ special_tokens_map = json.load(f)
269
+
270
+ # This checks the special tokens map file.
271
+ seen_special_tokens = set()
272
+ for token in DESIRED_MAPPING:
273
+ for key, value in token.to_special_tokens_map().items():
274
+ if key not in special_tokens_map:
275
+ raise ValueError(f"Special token map {key} not found in special tokens map")
276
+ if value != special_tokens_map[key]:
277
+ raise ValueError(f"Special token map {key} content mismatch: {value} != {special_tokens_map[key]}")
278
+
279
+ print(f"Special token map {key} content matches")
280
+ seen_special_tokens.add(key)
281
+
282
+ if len(seen_special_tokens) != len(special_tokens_map):
283
+ raise ValueError("Special tokens map values are not unique")
284
+ print("All special tokens map values match")
285
+
286
+
287
+ @cli.command()
288
+ def fix():
289
+ """Fix the tokens in the tokenizer config, tokenizer file, vocab file, and special tokens map file."""
290
+
291
+ print("STEP 1: Fixing tokenizer config file...")
292
+ with open(TOKENIZER_CONFIG_FILE, "r") as f:
293
+ tokenizer_config = json.load(f)
294
+
295
+ tokenizer_config["bos_token"] = get_bos_token(DESIRED_MAPPING).content
296
+ tokenizer_config["eos_token"] = get_eos_token(DESIRED_MAPPING).content
297
+ tokenizer_config["pad_token"] = get_pad_token(DESIRED_MAPPING).content
298
+ tokenizer_config["unk_token"] = get_unk_token(DESIRED_MAPPING).content
299
+ tokenizer_config["model_max_length"] = MODEL_MAX_LENGTH
300
+
301
+ added_tokens_decoder = {}
302
+ for token in DESIRED_MAPPING:
303
+ added_tokens_decoder.update(token.to_added_tokens_decoder())
304
+ tokenizer_config["added_tokens_decoder"] = added_tokens_decoder
305
+
306
+ with open(TOKENIZER_CONFIG_FILE, "w") as f:
307
+ json.dump(tokenizer_config, f, indent=2)
308
+ print(f"Updated tokenizer config file in {TOKENIZER_CONFIG_FILE}.")
309
+
310
+
311
+ print("STEP 2: Fixing tokenizer file...")
312
+ with open(TOKENIZER_FILE, "r") as f:
313
+ tokenizer = json.load(f)
314
+ added_tokens = []
315
+ for token in DESIRED_MAPPING:
316
+ added_tokens.append(token.to_added_tokens())
317
+ tokenizer["added_tokens"] = added_tokens
318
+
319
+ for token in DESIRED_MAPPING:
320
+ # check if vocab id is used already
321
+ for key in list(tokenizer["model"]["vocab"].keys()):
322
+ if tokenizer["model"]["vocab"][key] == token.id:
323
+ tokenizer["model"]["vocab"].pop(key)
324
+
325
+ # now that we know this is safe, add the token
326
+ tokenizer["model"]["vocab"][token.content] = token.id
327
+
328
+ with open(TOKENIZER_FILE, "w") as f:
329
+ json.dump(tokenizer, f, indent=2)
330
+
331
+ print(f"Updated tokenizer file in {TOKENIZER_FILE}.")
332
+
333
+ print("STEP 3: Fixing vocab file...")
334
+ with open(VOCAB_FILE, "r") as f:
335
+ vocab = json.load(f)
336
+ for token in DESIRED_MAPPING:
337
+ # check if vocab id is used already
338
+ for key in list(vocab.keys()):
339
+ if vocab[key] == token.id:
340
+ vocab.pop(key)
341
+
342
+ # now that we know this is safe, add the token
343
+ vocab[token.content] = token.id
344
+ with open(VOCAB_FILE, "w") as f:
345
+ json.dump(vocab, f, indent=2)
346
+ print(f"Updated vocab file in {VOCAB_FILE}.")
347
+
348
+ print("STEP 4: Fixing special tokens map file...")
349
+ with open(SPECIAL_TOKENS_MAP_FILE, "r") as f:
350
+ special_tokens_map = json.load(f)
351
+
352
+ for token in DESIRED_MAPPING:
353
+ for key, value in token.to_special_tokens_map().items():
354
+ special_tokens_map[key] = value
355
+ print(f"Updated special token map {key} content")
356
+
357
+ with open(SPECIAL_TOKENS_MAP_FILE, "w") as f:
358
+ json.dump(special_tokens_map, f, indent=2)
359
+
360
+ print(f"Updated special tokens map file in {SPECIAL_TOKENS_MAP_FILE}.")
361
+
362
+
363
+ if __name__ == "__main__":
364
+ cli()
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 100265,
5
+ 100257
6
+ ],
7
+ "pad_token": 100277,
8
+ "transformers_version": "4.53.1"
9
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33ad61d0da78fccd387f8a8ff26320fd88848331320f458e1451d2cacb317dc1
3
+ size 4969984976
model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d405c3680305ecfc1b998ea841a60f8d7481bf49c059fdc63b733fb95b7a7a7f
3
+ size 4981161496
model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f0737248de1a7d2fc4ee0eefa3be76d0ce9db9205a69eb0abf3fef6914d26f4
3
+ size 4644917240
model.safetensors.index.json ADDED
@@ -0,0 +1,363 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_parameters": 7298011136,
4
+ "total_size": 14596022272
5
+ },
6
+ "weight_map": {
7
+ "lm_head.weight": "model-00003-of-00003.safetensors",
8
+ "model.embed_tokens.weight": "model-00001-of-00003.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
13
+ "model.layers.0.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
14
+ "model.layers.0.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
15
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
16
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
17
+ "model.layers.0.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
18
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
19
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
20
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
21
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
22
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
23
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
24
+ "model.layers.1.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
25
+ "model.layers.1.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
26
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
27
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
28
+ "model.layers.1.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
29
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
30
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
31
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
32
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
33
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
34
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
35
+ "model.layers.10.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
36
+ "model.layers.10.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
37
+ "model.layers.10.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
38
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
39
+ "model.layers.10.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
40
+ "model.layers.10.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
41
+ "model.layers.10.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
42
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
43
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
44
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
45
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
46
+ "model.layers.11.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
47
+ "model.layers.11.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
48
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
49
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
50
+ "model.layers.11.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
51
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
52
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
53
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
54
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
55
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
56
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
57
+ "model.layers.12.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
58
+ "model.layers.12.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
59
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
60
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
61
+ "model.layers.12.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
62
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
63
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
64
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
65
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
66
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
67
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
68
+ "model.layers.13.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
69
+ "model.layers.13.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
70
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
71
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
72
+ "model.layers.13.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
73
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
74
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
75
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
76
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
77
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
78
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
79
+ "model.layers.14.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
80
+ "model.layers.14.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
81
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
82
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
83
+ "model.layers.14.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
84
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
85
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
86
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
87
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
88
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
89
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
90
+ "model.layers.15.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
91
+ "model.layers.15.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
92
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
93
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
94
+ "model.layers.15.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
95
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
96
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
97
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
98
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
99
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
100
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
101
+ "model.layers.16.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
102
+ "model.layers.16.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
103
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
104
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
105
+ "model.layers.16.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
106
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
107
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
108
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
109
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
110
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
111
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
112
+ "model.layers.17.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
113
+ "model.layers.17.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
114
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
115
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
116
+ "model.layers.17.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
117
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
118
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
119
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
120
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
121
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
122
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
123
+ "model.layers.18.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
124
+ "model.layers.18.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
125
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
126
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
127
+ "model.layers.18.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
128
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
129
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
130
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
131
+ "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
132
+ "model.layers.19.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
133
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
134
+ "model.layers.19.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
135
+ "model.layers.19.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
136
+ "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
137
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
138
+ "model.layers.19.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
139
+ "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
140
+ "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
141
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
142
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
143
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
144
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
145
+ "model.layers.2.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
146
+ "model.layers.2.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
147
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
148
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
149
+ "model.layers.2.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
150
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
151
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
152
+ "model.layers.20.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
153
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
154
+ "model.layers.20.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
155
+ "model.layers.20.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
156
+ "model.layers.20.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
157
+ "model.layers.20.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
158
+ "model.layers.20.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
159
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
160
+ "model.layers.20.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
161
+ "model.layers.20.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
162
+ "model.layers.20.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
163
+ "model.layers.21.mlp.down_proj.weight": "model-00002-of-00003.safetensors",
164
+ "model.layers.21.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
165
+ "model.layers.21.mlp.up_proj.weight": "model-00002-of-00003.safetensors",
166
+ "model.layers.21.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
167
+ "model.layers.21.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors",
168
+ "model.layers.21.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
169
+ "model.layers.21.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
170
+ "model.layers.21.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
171
+ "model.layers.21.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
172
+ "model.layers.21.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
173
+ "model.layers.21.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
174
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
175
+ "model.layers.22.mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
176
+ "model.layers.22.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
177
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
178
+ "model.layers.22.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
179
+ "model.layers.22.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
180
+ "model.layers.22.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
181
+ "model.layers.22.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
182
+ "model.layers.22.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
183
+ "model.layers.22.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
184
+ "model.layers.22.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
185
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
186
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
187
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
188
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
189
+ "model.layers.23.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
190
+ "model.layers.23.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
191
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
192
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
193
+ "model.layers.23.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
194
+ "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
195
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
196
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
197
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
198
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
199
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
200
+ "model.layers.24.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
201
+ "model.layers.24.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
202
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
203
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
204
+ "model.layers.24.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
205
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
206
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
207
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
208
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
209
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
210
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
211
+ "model.layers.25.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
212
+ "model.layers.25.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
213
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
214
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
215
+ "model.layers.25.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
216
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
217
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
218
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
219
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
220
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
221
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
222
+ "model.layers.26.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
223
+ "model.layers.26.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
224
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
225
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
226
+ "model.layers.26.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
227
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
228
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
229
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
230
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
231
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
232
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
233
+ "model.layers.27.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
234
+ "model.layers.27.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
235
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
236
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
237
+ "model.layers.27.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
238
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
239
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
240
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
241
+ "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
242
+ "model.layers.28.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
243
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
244
+ "model.layers.28.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
245
+ "model.layers.28.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
246
+ "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
247
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
248
+ "model.layers.28.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
249
+ "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
250
+ "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
251
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
252
+ "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
253
+ "model.layers.29.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
254
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
255
+ "model.layers.29.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
256
+ "model.layers.29.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
257
+ "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
258
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
259
+ "model.layers.29.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
260
+ "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
261
+ "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
262
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
263
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
264
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
265
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
266
+ "model.layers.3.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
267
+ "model.layers.3.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
268
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
269
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
270
+ "model.layers.3.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
271
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
272
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
273
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
274
+ "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
275
+ "model.layers.30.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
276
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
277
+ "model.layers.30.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
278
+ "model.layers.30.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
279
+ "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
280
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
281
+ "model.layers.30.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
282
+ "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
283
+ "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
284
+ "model.layers.31.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
285
+ "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
286
+ "model.layers.31.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
287
+ "model.layers.31.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
288
+ "model.layers.31.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors",
289
+ "model.layers.31.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
290
+ "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
291
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
292
+ "model.layers.31.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
293
+ "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
294
+ "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
295
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
296
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
297
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
298
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
299
+ "model.layers.4.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
300
+ "model.layers.4.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
301
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
302
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
303
+ "model.layers.4.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
304
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
305
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
306
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
307
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
308
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
309
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
310
+ "model.layers.5.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
311
+ "model.layers.5.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
312
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
313
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
314
+ "model.layers.5.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
315
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
316
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
317
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
318
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
319
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
320
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
321
+ "model.layers.6.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
322
+ "model.layers.6.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
323
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
324
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
325
+ "model.layers.6.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
326
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
327
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
328
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
329
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
330
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
331
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
332
+ "model.layers.7.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
333
+ "model.layers.7.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
334
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
335
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
336
+ "model.layers.7.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
337
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
338
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
339
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
340
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
341
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
342
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
343
+ "model.layers.8.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
344
+ "model.layers.8.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
345
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
346
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
347
+ "model.layers.8.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
348
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
349
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
350
+ "model.layers.9.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
351
+ "model.layers.9.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
352
+ "model.layers.9.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
353
+ "model.layers.9.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
354
+ "model.layers.9.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors",
355
+ "model.layers.9.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
356
+ "model.layers.9.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
357
+ "model.layers.9.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
358
+ "model.layers.9.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
359
+ "model.layers.9.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
360
+ "model.layers.9.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
361
+ "model.norm.weight": "model-00003-of-00003.safetensors"
362
+ }
363
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|pad|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<|endoftext|>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "100256": {
5
+ "content": "<|extra_id_0|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": false
11
+ },
12
+ "100257": {
13
+ "content": "<|endoftext|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "100258": {
21
+ "content": "<|fim_prefix|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "100259": {
29
+ "content": "<|fim_middle|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "100260": {
37
+ "content": "<|fim_suffix|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "100261": {
45
+ "content": "|||PHONE_NUMBER|||",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": false
51
+ },
52
+ "100262": {
53
+ "content": "|||EMAIL_ADDRESS|||",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": false
59
+ },
60
+ "100263": {
61
+ "content": "|||IP_ADDRESS|||",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": false
67
+ },
68
+ "100264": {
69
+ "content": "<|im_start|>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "100265": {
77
+ "content": "<|im_end|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "100266": {
85
+ "content": "<|extra_id_1|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": false
91
+ },
92
+ "100267": {
93
+ "content": "<|extra_id_2|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": false
99
+ },
100
+ "100268": {
101
+ "content": "<|extra_id_3|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": false
107
+ },
108
+ "100269": {
109
+ "content": "<|extra_id_4|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": false
115
+ },
116
+ "100270": {
117
+ "content": "<|extra_id_5|>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": false
123
+ },
124
+ "100271": {
125
+ "content": "<|extra_id_6|>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": false
131
+ },
132
+ "100272": {
133
+ "content": "<|extra_id_7|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": false
139
+ },
140
+ "100273": {
141
+ "content": "<|extra_id_8|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": false
147
+ },
148
+ "100274": {
149
+ "content": "<|extra_id_9|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": false
155
+ },
156
+ "100275": {
157
+ "content": "<|extra_id_10|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": false
163
+ },
164
+ "100276": {
165
+ "content": "<|endofprompt|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": true
171
+ },
172
+ "100277": {
173
+ "content": "<|pad|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": true
179
+ }
180
+ },
181
+ "bos_token": "<|endoftext|>",
182
+ "chat_template": "{% set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 %}{% if not has_system %}{{ '<|im_start|>system\nYou are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n' }}{% endif %}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|im_start|>system\n' + message['content'] }}{% if message.get('functions', none) is not none %}{{ ' <functions>' + message['functions'] + '</functions><|im_end|>\n' }}{% else %}{{ ' You do not currently have access to any functions. <functions></functions><|im_end|>\n' }}{% endif %}{% elif message['role'] == 'user' %}{% if message.get('functions', none) is not none %}{{ '<|im_start|>user\n' + message['content'] + '\n' + '<functions>' + message['functions'] + '</functions><|im_end|>\n' }}{% else %}{{ '<|im_start|>user\n' + message['content'] + '<|im_end|>\n' }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '<|im_start|>assistant\n' }}{% if message.get('content', none) is not none %}{{ message['content'] }}{% endif %}{% if message.get('function_calls', none) is not none %}{{ '<function_calls>' + message['function_calls'] + '</function_calls>' }}{% endif %}{% if not loop.last %}{{ '<|im_end|>' + '\n' }}{% else %}{{ eos_token }}{% endif %}{% elif message['role'] == 'environment' %}{{ '<|im_start|>environment\n' + message['content'] + '<|im_end|>\n' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|im_start|>assistant\n<think>' }}{% endif %}{% endfor %}",
183
+ "clean_up_tokenization_spaces": false,
184
+ "eos_token": "<|endoftext|>",
185
+ "model_max_length": 65536,
186
+ "pad_token": "<|pad|>",
187
+ "tokenizer_class": "GPT2Tokenizer",
188
+ "unk_token": "<|endoftext|>"
189
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff