danielhanchen
commited on
Commit
•
6e54b93
1
Parent(s):
20a67e2
Upload tokenizer
Browse files- added_tokens.json +3 -0
- special_tokens_map.json +1 -7
- tokenizer.json +10 -1
- tokenizer_config.json +11 -3
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<pad>": 32768
|
3 |
+
}
|
special_tokens_map.json
CHANGED
@@ -13,13 +13,7 @@
|
|
13 |
"rstrip": false,
|
14 |
"single_word": false
|
15 |
},
|
16 |
-
"pad_token":
|
17 |
-
"content": "[control_14]",
|
18 |
-
"lstrip": false,
|
19 |
-
"normalized": false,
|
20 |
-
"rstrip": false,
|
21 |
-
"single_word": false
|
22 |
-
},
|
23 |
"unk_token": {
|
24 |
"content": "<unk>",
|
25 |
"lstrip": false,
|
|
|
13 |
"rstrip": false,
|
14 |
"single_word": false
|
15 |
},
|
16 |
+
"pad_token": "<pad>",
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
"unk_token": {
|
18 |
"content": "<unk>",
|
19 |
"lstrip": false,
|
tokenizer.json
CHANGED
@@ -154,7 +154,7 @@
|
|
154 |
"lstrip": false,
|
155 |
"rstrip": false,
|
156 |
"normalized": false,
|
157 |
-
"special":
|
158 |
},
|
159 |
{
|
160 |
"id": 17,
|
@@ -6941,6 +6941,15 @@
|
|
6941 |
"rstrip": false,
|
6942 |
"normalized": false,
|
6943 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6944 |
}
|
6945 |
],
|
6946 |
"normalizer": {
|
|
|
154 |
"lstrip": false,
|
155 |
"rstrip": false,
|
156 |
"normalized": false,
|
157 |
+
"special": false
|
158 |
},
|
159 |
{
|
160 |
"id": 17,
|
|
|
6941 |
"rstrip": false,
|
6942 |
"normalized": false,
|
6943 |
"special": false
|
6944 |
+
},
|
6945 |
+
{
|
6946 |
+
"id": 32768,
|
6947 |
+
"content": "<pad>",
|
6948 |
+
"single_word": false,
|
6949 |
+
"lstrip": false,
|
6950 |
+
"rstrip": false,
|
6951 |
+
"normalized": false,
|
6952 |
+
"special": true
|
6953 |
}
|
6954 |
],
|
6955 |
"normalizer": {
|
tokenizer_config.json
CHANGED
@@ -137,7 +137,7 @@
|
|
137 |
"normalized": false,
|
138 |
"rstrip": false,
|
139 |
"single_word": false,
|
140 |
-
"special":
|
141 |
},
|
142 |
"17": {
|
143 |
"content": "[control_15]",
|
@@ -6170,15 +6170,23 @@
|
|
6170 |
"rstrip": false,
|
6171 |
"single_word": false,
|
6172 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6173 |
}
|
6174 |
},
|
6175 |
"bos_token": "<s>",
|
6176 |
-
"chat_template": "{%- if messages[0][
|
6177 |
"clean_up_tokenization_spaces": false,
|
6178 |
"eos_token": "</s>",
|
6179 |
"legacy": true,
|
6180 |
"model_max_length": 1000000000000000019884624838656,
|
6181 |
-
"pad_token": "
|
6182 |
"padding_side": "left",
|
6183 |
"sp_model_kwargs": {},
|
6184 |
"spaces_between_special_tokens": false,
|
|
|
137 |
"normalized": false,
|
138 |
"rstrip": false,
|
139 |
"single_word": false,
|
140 |
+
"special": false
|
141 |
},
|
142 |
"17": {
|
143 |
"content": "[control_15]",
|
|
|
6170 |
"rstrip": false,
|
6171 |
"single_word": false,
|
6172 |
"special": false
|
6173 |
+
},
|
6174 |
+
"32768": {
|
6175 |
+
"content": "<pad>",
|
6176 |
+
"lstrip": false,
|
6177 |
+
"normalized": false,
|
6178 |
+
"rstrip": false,
|
6179 |
+
"single_word": false,
|
6180 |
+
"special": true
|
6181 |
}
|
6182 |
},
|
6183 |
"bos_token": "<s>",
|
6184 |
+
"chat_template": "{%- if messages[0][\"role\"] == \"system\" %}\n {%- set system_message = messages[0][\"content\"] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n{%- set user_messages = loop_messages | selectattr(\"role\", \"equalto\", \"user\") | list %}\n\n{%- for message in loop_messages | rejectattr(\"role\", \"equalto\", \"tool\") | rejectattr(\"role\", \"equalto\", \"tool_results\") | selectattr(\"tool_calls\", \"undefined\") %}\n {%- if (message[\"role\"] == \"user\") != (loop.index0 % 2 == 0) %}\n {{- raise_exception(\"After the optional system message, conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif %}\n{%- endfor %}\n\n{{- bos_token }}\n{%- for message in loop_messages %}\n {%- if message[\"role\"] == \"user\" %}\n {%- if tools is not none and (message == user_messages[-1]) %}\n {{- \"[AVAILABLE_TOOLS] [\" }}\n {%- for tool in tools %}\n {%- set tool = tool.function %}\n {{- '{\"type\": \"function\", \"function\": {' }}\n {%- for key, val in tool.items() if key != \"return\" %}\n {%- if val is string %}\n {{- '\"' + key + '\": \"' + val + '\"' }}\n {%- else %}\n {{- '\"' + key + '\": ' + val|tojson }}\n {%- endif %}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \"}}\" }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- else %}\n {{- \"]\" }}\n {%- endif %}\n {%- endfor %}\n {{- \"[/AVAILABLE_TOOLS]\" }}\n {%- endif %}\n {%- if loop.last and system_message is defined %}\n {{- \"[INST] \" + system_message + \"\\n\\n\" + message[\"content\"] + \"[/INST]\" }}\n {%- else %}\n {{- \"[INST] \" + message[\"content\"] + \"[/INST]\" }}\n {%- endif %}\n {%- elif message[\"role\"] == \"tool_calls\" or message.tool_calls is defined %}\n {%- if message.tool_calls is defined %}\n {%- set tool_calls = message.tool_calls %}\n {%- else %}\n {%- set tool_calls = message.content %}\n {%- endif %}\n {{- \"[TOOL_CALLS] [\" }}\n {%- for tool_call in tool_calls %}\n {%- set out = tool_call.function|tojson %}\n {{- out[:-1] }}\n {%- if not tool_call.id is defined or tool_call.id|length != 9 %}\n {{- raise_exception(\"Tool call IDs should be alphanumeric strings with length 9!\") }}\n {%- endif %}\n {{- ', \"id\": \"' + tool_call.id + '\"}' }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- else %}\n {{- \"]\" + eos_token }}\n {%- endif %}\n {%- endfor %}\n {%- elif message[\"role\"] == \"assistant\" %}\n {{- \" \" + message[\"content\"] + eos_token}}\n {%- elif message[\"role\"] == \"tool_results\" or message[\"role\"] == \"tool\" %}\n {%- if message.content is defined and message.content.content is defined %}\n {%- set content = message.content.content %}\n {%- else %}\n {%- set content = message.content %}\n {%- endif %}\n {{- '[TOOL_RESULTS] {\"content\": ' + content|string + \", \" }}\n {%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}\n {{- raise_exception(\"Tool call IDs should be alphanumeric strings with length 9!\") }}\n {%- endif %}\n {{- '\"call_id\": \"' + message.tool_call_id + '\"}[/TOOL_RESULTS]' }}\n {%- else %}\n {{- raise_exception(\"Only user and assistant roles are supported, with the exception of an initial optional system message!\") }}\n {%- endif %}\n{%- endfor %}\n",
|
6185 |
"clean_up_tokenization_spaces": false,
|
6186 |
"eos_token": "</s>",
|
6187 |
"legacy": true,
|
6188 |
"model_max_length": 1000000000000000019884624838656,
|
6189 |
+
"pad_token": "<pad>",
|
6190 |
"padding_side": "left",
|
6191 |
"sp_model_kwargs": {},
|
6192 |
"spaces_between_special_tokens": false,
|