Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- chat_template.jinja +4 -4
- tokenizer_config.json +31 -31
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
chat_template.jinja
CHANGED
|
@@ -111,7 +111,7 @@ declaration:{{- tool_data['function']['name'] -}}
|
|
| 111 |
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 112 |
{%- endfor -%}
|
| 113 |
{{- '}' -}}
|
| 114 |
-
{%- elif argument is
|
| 115 |
{{- '[' -}}
|
| 116 |
{%- for item in argument -%}
|
| 117 |
{{- format_argument(item, escape_keys=escape_keys) -}}
|
|
@@ -131,7 +131,7 @@ declaration:{{- tool_data['function']['name'] -}}
|
|
| 131 |
{%- if messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}
|
| 132 |
{%- if messages[0]['content'] is string -%}
|
| 133 |
{{- messages[0]['content'] | trim -}}
|
| 134 |
-
{%- elif messages[0]['content'] is
|
| 135 |
{%- for item in messages[0]['content'] -%}
|
| 136 |
{%- if item['type'] == 'text' -%}
|
| 137 |
{{- item['text'] | trim -}}
|
|
@@ -165,7 +165,7 @@ declaration:{{- tool_data['function']['name'] -}}
|
|
| 165 |
{%- if 'content' in message and message['content'] is not none -%}
|
| 166 |
{%- if message['content'] is string -%}
|
| 167 |
{{ message['content'] | trim }}
|
| 168 |
-
{%- elif message['content'] is
|
| 169 |
{%- for item in message['content'] -%}
|
| 170 |
{%- if item['type'] == 'image' -%}
|
| 171 |
{{ '<start_of_image>' }}
|
|
@@ -234,7 +234,7 @@ declaration:{{- tool_data['function']['name'] -}}
|
|
| 234 |
{%- else -%}
|
| 235 |
{{ raise_exception("Invalid tool response: 'name' must be provided.") }}
|
| 236 |
{%- endif -%}
|
| 237 |
-
{%- elif message['content'] is
|
| 238 |
{%- for item in message['content'] -%}
|
| 239 |
{%- if item is mapping -%}
|
| 240 |
{%- if 'name' in item and 'response' in item -%}
|
|
|
|
| 111 |
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 112 |
{%- endfor -%}
|
| 113 |
{{- '}' -}}
|
| 114 |
+
{%- elif argument is iterable -%}
|
| 115 |
{{- '[' -}}
|
| 116 |
{%- for item in argument -%}
|
| 117 |
{{- format_argument(item, escape_keys=escape_keys) -}}
|
|
|
|
| 131 |
{%- if messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}
|
| 132 |
{%- if messages[0]['content'] is string -%}
|
| 133 |
{{- messages[0]['content'] | trim -}}
|
| 134 |
+
{%- elif messages[0]['content'] is iterable -%}
|
| 135 |
{%- for item in messages[0]['content'] -%}
|
| 136 |
{%- if item['type'] == 'text' -%}
|
| 137 |
{{- item['text'] | trim -}}
|
|
|
|
| 165 |
{%- if 'content' in message and message['content'] is not none -%}
|
| 166 |
{%- if message['content'] is string -%}
|
| 167 |
{{ message['content'] | trim }}
|
| 168 |
+
{%- elif message['content'] is iterable -%}
|
| 169 |
{%- for item in message['content'] -%}
|
| 170 |
{%- if item['type'] == 'image' -%}
|
| 171 |
{{ '<start_of_image>' }}
|
|
|
|
| 234 |
{%- else -%}
|
| 235 |
{{ raise_exception("Invalid tool response: 'name' must be provided.") }}
|
| 236 |
{%- endif -%}
|
| 237 |
+
{%- elif message['content'] is iterable -%}
|
| 238 |
{%- for item in message['content'] -%}
|
| 239 |
{%- if item is mapping -%}
|
| 240 |
{%- if 'name' in item and 'response' in item -%}
|
tokenizer_config.json
CHANGED
|
@@ -1107,7 +1107,7 @@
|
|
| 1107 |
"special": false
|
| 1108 |
},
|
| 1109 |
"138": {
|
| 1110 |
-
"content": "
|
| 1111 |
"lstrip": false,
|
| 1112 |
"normalized": false,
|
| 1113 |
"rstrip": false,
|
|
@@ -1115,7 +1115,7 @@
|
|
| 1115 |
"special": false
|
| 1116 |
},
|
| 1117 |
"139": {
|
| 1118 |
-
"content": "
|
| 1119 |
"lstrip": false,
|
| 1120 |
"normalized": false,
|
| 1121 |
"rstrip": false,
|
|
@@ -1123,7 +1123,7 @@
|
|
| 1123 |
"special": false
|
| 1124 |
},
|
| 1125 |
"140": {
|
| 1126 |
-
"content": "
|
| 1127 |
"lstrip": false,
|
| 1128 |
"normalized": false,
|
| 1129 |
"rstrip": false,
|
|
@@ -1131,7 +1131,7 @@
|
|
| 1131 |
"special": false
|
| 1132 |
},
|
| 1133 |
"141": {
|
| 1134 |
-
"content": "
|
| 1135 |
"lstrip": false,
|
| 1136 |
"normalized": false,
|
| 1137 |
"rstrip": false,
|
|
@@ -1139,7 +1139,7 @@
|
|
| 1139 |
"special": false
|
| 1140 |
},
|
| 1141 |
"142": {
|
| 1142 |
-
"content": "
|
| 1143 |
"lstrip": false,
|
| 1144 |
"normalized": false,
|
| 1145 |
"rstrip": false,
|
|
@@ -1147,7 +1147,7 @@
|
|
| 1147 |
"special": false
|
| 1148 |
},
|
| 1149 |
"143": {
|
| 1150 |
-
"content": "
|
| 1151 |
"lstrip": false,
|
| 1152 |
"normalized": false,
|
| 1153 |
"rstrip": false,
|
|
@@ -1155,7 +1155,7 @@
|
|
| 1155 |
"special": false
|
| 1156 |
},
|
| 1157 |
"144": {
|
| 1158 |
-
"content": "
|
| 1159 |
"lstrip": false,
|
| 1160 |
"normalized": false,
|
| 1161 |
"rstrip": false,
|
|
@@ -1163,7 +1163,7 @@
|
|
| 1163 |
"special": false
|
| 1164 |
},
|
| 1165 |
"145": {
|
| 1166 |
-
"content": "
|
| 1167 |
"lstrip": false,
|
| 1168 |
"normalized": false,
|
| 1169 |
"rstrip": false,
|
|
@@ -1171,7 +1171,7 @@
|
|
| 1171 |
"special": false
|
| 1172 |
},
|
| 1173 |
"146": {
|
| 1174 |
-
"content": "
|
| 1175 |
"lstrip": false,
|
| 1176 |
"normalized": false,
|
| 1177 |
"rstrip": false,
|
|
@@ -1179,7 +1179,7 @@
|
|
| 1179 |
"special": false
|
| 1180 |
},
|
| 1181 |
"147": {
|
| 1182 |
-
"content": "
|
| 1183 |
"lstrip": false,
|
| 1184 |
"normalized": false,
|
| 1185 |
"rstrip": false,
|
|
@@ -1187,7 +1187,7 @@
|
|
| 1187 |
"special": false
|
| 1188 |
},
|
| 1189 |
"148": {
|
| 1190 |
-
"content": "
|
| 1191 |
"lstrip": false,
|
| 1192 |
"normalized": false,
|
| 1193 |
"rstrip": false,
|
|
@@ -1195,7 +1195,7 @@
|
|
| 1195 |
"special": false
|
| 1196 |
},
|
| 1197 |
"149": {
|
| 1198 |
-
"content": "
|
| 1199 |
"lstrip": false,
|
| 1200 |
"normalized": false,
|
| 1201 |
"rstrip": false,
|
|
@@ -1203,7 +1203,7 @@
|
|
| 1203 |
"special": false
|
| 1204 |
},
|
| 1205 |
"150": {
|
| 1206 |
-
"content": "
|
| 1207 |
"lstrip": false,
|
| 1208 |
"normalized": false,
|
| 1209 |
"rstrip": false,
|
|
@@ -1211,7 +1211,7 @@
|
|
| 1211 |
"special": false
|
| 1212 |
},
|
| 1213 |
"151": {
|
| 1214 |
-
"content": "
|
| 1215 |
"lstrip": false,
|
| 1216 |
"normalized": false,
|
| 1217 |
"rstrip": false,
|
|
@@ -1219,7 +1219,7 @@
|
|
| 1219 |
"special": false
|
| 1220 |
},
|
| 1221 |
"152": {
|
| 1222 |
-
"content": "
|
| 1223 |
"lstrip": false,
|
| 1224 |
"normalized": false,
|
| 1225 |
"rstrip": false,
|
|
@@ -1227,7 +1227,7 @@
|
|
| 1227 |
"special": false
|
| 1228 |
},
|
| 1229 |
"153": {
|
| 1230 |
-
"content": "
|
| 1231 |
"lstrip": false,
|
| 1232 |
"normalized": false,
|
| 1233 |
"rstrip": false,
|
|
@@ -1235,7 +1235,7 @@
|
|
| 1235 |
"special": false
|
| 1236 |
},
|
| 1237 |
"154": {
|
| 1238 |
-
"content": "
|
| 1239 |
"lstrip": false,
|
| 1240 |
"normalized": false,
|
| 1241 |
"rstrip": false,
|
|
@@ -1243,7 +1243,7 @@
|
|
| 1243 |
"special": false
|
| 1244 |
},
|
| 1245 |
"155": {
|
| 1246 |
-
"content": "
|
| 1247 |
"lstrip": false,
|
| 1248 |
"normalized": false,
|
| 1249 |
"rstrip": false,
|
|
@@ -1251,7 +1251,7 @@
|
|
| 1251 |
"special": false
|
| 1252 |
},
|
| 1253 |
"156": {
|
| 1254 |
-
"content": "
|
| 1255 |
"lstrip": false,
|
| 1256 |
"normalized": false,
|
| 1257 |
"rstrip": false,
|
|
@@ -1259,7 +1259,7 @@
|
|
| 1259 |
"special": false
|
| 1260 |
},
|
| 1261 |
"157": {
|
| 1262 |
-
"content": "
|
| 1263 |
"lstrip": false,
|
| 1264 |
"normalized": false,
|
| 1265 |
"rstrip": false,
|
|
@@ -1267,7 +1267,7 @@
|
|
| 1267 |
"special": false
|
| 1268 |
},
|
| 1269 |
"158": {
|
| 1270 |
-
"content": "
|
| 1271 |
"lstrip": false,
|
| 1272 |
"normalized": false,
|
| 1273 |
"rstrip": false,
|
|
@@ -1275,7 +1275,7 @@
|
|
| 1275 |
"special": false
|
| 1276 |
},
|
| 1277 |
"159": {
|
| 1278 |
-
"content": "
|
| 1279 |
"lstrip": false,
|
| 1280 |
"normalized": false,
|
| 1281 |
"rstrip": false,
|
|
@@ -1283,7 +1283,7 @@
|
|
| 1283 |
"special": false
|
| 1284 |
},
|
| 1285 |
"160": {
|
| 1286 |
-
"content": "
|
| 1287 |
"lstrip": false,
|
| 1288 |
"normalized": false,
|
| 1289 |
"rstrip": false,
|
|
@@ -1291,7 +1291,7 @@
|
|
| 1291 |
"special": false
|
| 1292 |
},
|
| 1293 |
"161": {
|
| 1294 |
-
"content": "
|
| 1295 |
"lstrip": false,
|
| 1296 |
"normalized": false,
|
| 1297 |
"rstrip": false,
|
|
@@ -1299,7 +1299,7 @@
|
|
| 1299 |
"special": false
|
| 1300 |
},
|
| 1301 |
"162": {
|
| 1302 |
-
"content": "
|
| 1303 |
"lstrip": false,
|
| 1304 |
"normalized": false,
|
| 1305 |
"rstrip": false,
|
|
@@ -1307,7 +1307,7 @@
|
|
| 1307 |
"special": false
|
| 1308 |
},
|
| 1309 |
"163": {
|
| 1310 |
-
"content": "
|
| 1311 |
"lstrip": false,
|
| 1312 |
"normalized": false,
|
| 1313 |
"rstrip": false,
|
|
@@ -1315,7 +1315,7 @@
|
|
| 1315 |
"special": false
|
| 1316 |
},
|
| 1317 |
"164": {
|
| 1318 |
-
"content": "
|
| 1319 |
"lstrip": false,
|
| 1320 |
"normalized": false,
|
| 1321 |
"rstrip": false,
|
|
@@ -1323,7 +1323,7 @@
|
|
| 1323 |
"special": false
|
| 1324 |
},
|
| 1325 |
"165": {
|
| 1326 |
-
"content": "
|
| 1327 |
"lstrip": false,
|
| 1328 |
"normalized": false,
|
| 1329 |
"rstrip": false,
|
|
@@ -1331,7 +1331,7 @@
|
|
| 1331 |
"special": false
|
| 1332 |
},
|
| 1333 |
"166": {
|
| 1334 |
-
"content": "
|
| 1335 |
"lstrip": false,
|
| 1336 |
"normalized": false,
|
| 1337 |
"rstrip": false,
|
|
@@ -1339,7 +1339,7 @@
|
|
| 1339 |
"special": false
|
| 1340 |
},
|
| 1341 |
"167": {
|
| 1342 |
-
"content": "
|
| 1343 |
"lstrip": false,
|
| 1344 |
"normalized": false,
|
| 1345 |
"rstrip": false,
|
|
@@ -51352,5 +51352,5 @@
|
|
| 51352 |
"tokenizer_class": "GemmaTokenizerFast",
|
| 51353 |
"unk_token": "<unk>",
|
| 51354 |
"use_default_system_prompt": false,
|
| 51355 |
-
"chat_template": "{%- macro format_parameters(properties, required) -%}\n {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in properties | dictsort -%}\n {%- if key not in standard_keys -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {{- key }}:{description:<escape>{{ value['description'] }}<escape>\n {%- if value['type'] | upper == 'STRING' -%}\n {%- if value['enum'] -%}\n ,enum:{{ format_argument(value['enum']) }}\n {%- endif -%}\n {%- elif value['type'] | upper == 'OBJECT' -%}\n ,properties:{\n {%- if value['properties'] is defined and value['properties'] is mapping -%}\n {{- format_parameters(value['properties'], value['required'] | default([])) -}}\n {%- elif value is mapping -%}\n {{- format_parameters(value, value['required'] | default([])) -}}\n {%- endif -%}\n }\n {%- if value['required'] -%}\n ,required:[\n {%- for item in value['required'] | default([]) -%}\n <escape>{{- item -}}<escape>\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n ]\n {%- endif -%}\n {%- elif value['type'] | upper == 'ARRAY' -%}\n {%- if value['items'] is mapping and value['items'] -%}\n ,items:{\n {%- set ns_items = namespace(found_first=false) -%}\n {%- for item_key, item_value in value['items'] | dictsort -%}\n {%- if item_value is not none -%}\n {%- if ns_items.found_first %},{% endif -%}\n {%- set ns_items.found_first = true -%}\n {%- if item_key == 'properties' -%}\n properties:{\n {%- if item_value is mapping -%}\n {{- format_parameters(item_value, value['items']['required'] | default([])) -}}\n {%- endif -%}\n }\n {%- elif item_key == 'required' -%}\n required:[\n {%- for req_item in item_value -%}\n <escape>{{- req_item -}}<escape>\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n ]\n {%- elif item_key == 'type' -%}\n {%- if item_value is string -%}\n type:{{ format_argument(item_value | upper) }}\n {%- else -%}\n type:{{ format_argument(item_value | map('upper') | list) }}\n {%- endif -%}\n {%- else -%}\n {{ item_key }}:{{ format_argument(item_value) }}\n {%- endif -%}\n {%- endif -%}\n {%- endfor -%}\n }\n {%- endif -%}\n {%- endif -%}\n ,type:<escape>{{ value['type'] | upper }}<escape>}\n {%- endif -%}\n {%- endfor -%}\n{%- endmacro -%}\n{% macro format_function_declaration(tool_data) -%}\ndeclaration:{{- tool_data['function']['name'] -}}\n{description:<escape>{{- tool_data['function']['description'] -}}<escape>\n{%- set params = tool_data['function']['parameters'] -%}\n{%- if params -%}\n ,parameters:{\n {%- if params['properties'] -%}\n properties:{ {{- format_parameters(params['properties'], params['required']) -}} },\n {%- endif -%}\n {%- if params['required'] -%}\n required:[\n {%- for item in params['required'] -%}\n <escape>{{- item -}}<escape>\n {{- ',' if not loop.last -}}\n {%- endfor -%}\n ],\n {%- endif -%}\n {%- if params['type'] -%}\n type:<escape>{{- params['type'] | upper -}}<escape>}\n {%- endif -%}\n{%- endif -%}\n}\n{%- endmacro -%}\n{% macro format_argument(argument, escape_keys=True) -%}\n{%- if argument is string -%}\n {{- '<escape>' + argument + '<escape>' -}}\n{%- elif argument is boolean -%}\n {%- if argument -%}\n {{- 'true' -}}\n {%- else -%}\n {{- 'false' -}}\n {%- endif -%}\n{%- elif argument is mapping -%}\n {{- '{' -}}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in argument | dictsort -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {%- if escape_keys -%}\n {{- '<escape>' + key + '<escape>' -}}\n {%- else -%}\n {{- key -}}\n {%- endif -%}\n :{{- format_argument(value, escape_keys=escape_keys) -}}\n {%- endfor -%}\n {{- '}' -}}\n{%- elif argument is sequence -%}\n {{- '[' -}}\n {%- for item in argument -%}\n {{- format_argument(item, escape_keys=escape_keys) -}}\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n {{- ']' -}}\n{%- else -%}\n {{- argument -}}\n{%- endif -%}\n{%- endmacro -%}\n{{ bos_token }}\n{%- set ns = namespace(prev_message_type=None) -%}\n{#- Tool Declarations -#}\n{%- set loop_messages = messages -%}\n{%- if tools or messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}\n {{- '<start_of_turn>developer\\n' -}}\n {%- if messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}\n {%- if messages[0]['content'] is string -%}\n {{- messages[0]['content'] | trim -}}\n {%- elif messages[0]['content'] is sequence -%}\n {%- for item in messages[0]['content'] -%}\n {%- if item['type'] == 'text' -%}\n {{- item['text'] | trim -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n {%- endif -%}\n {%- if tools -%}\n {%- for tool in tools %}\n {{- '<start_function_declaration>' -}}\n {{- format_function_declaration(tool) | trim }}\n {{- '<end_function_declaration>' -}}\n {%- endfor %}\n {%- endif -%}\n {{- '<end_of_turn>\\n' }}\n{%- endif %}\n{#- Loop through messages. -#}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'assistant') -%}\n {#- Rename \"assistant\" to \"model\". -#}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {%- if role != 'tool' -%}\n {%- if ns.prev_message_type != 'tool_response' -%}\n {{- '<start_of_turn>' + role + '\\n' }}\n {%- endif -%}\n {%- set ns.prev_message_type = None -%}\n {%- if 'content' in message and message['content'] is not none -%}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is sequence -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type in user/assistant message\") }}\n {%- endif -%}\n {%- set ns.prev_message_type = 'content' -%}\n {%- endif -%}\n {%- if 'tool_calls' in message and message['tool_calls'] and message['tool_calls'] is iterable -%}\n {#- Tool Calls -#}\n {%- for tool_call in message['tool_calls'] -%}\n {% set function = tool_call['function'] %}\n {{- '<start_function_call>call:' + function['name'] + '{' -}}\n {%- if 'arguments' in function -%}\n {%- if function['arguments'] is mapping -%}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in function['arguments'] | dictsort -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {%- elif function['arguments'] is string -%}\n {# This handles string-JSON, just in case #}\n {{ function['arguments'] }}\n {%- endif %}\n {%- endif -%}\n {{- '}<end_function_call>' -}}\n {%- endfor -%}\n {%- if loop.last -%}\n {{ '<start_function_response>' }}\n {%- endif -%}\n {%- set ns.prev_message_type = 'tool_call' -%}\n {%- endif -%}\n {%- else -%}\n {#- Tool Responses -#}\n {%- if 'content' in message and message['content'] -%}\n {%- if message['content'] is mapping -%}\n {%- if 'name' in message['content'] and 'response' in message['content'] -%}\n {{ '<start_function_response>response:' + message['content']['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in message['content']['response'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- elif 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in message['content'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response mapping: must contain 'name' and 'response' keys, or 'name' must be in the message.\") }}\n {%- endif -%}\n {%- elif message['content'] is string -%}\n {%- if 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{value:' + format_argument(message['content'], escape_keys=False) + '}<end_function_response>' }}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response: 'name' must be provided.\") }}\n {%- endif -%}\n {%- elif message['content'] is sequence -%}\n {%- for item in message['content'] -%}\n {%- if item is mapping -%}\n {%- if 'name' in item and 'response' in item -%}\n {{ '<start_function_response>response:' + item['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in item['response'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- elif 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in item | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response mapping: must contain 'name' and 'response' keys, or 'name' must be in the message.\") }}\n {%- endif -%}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response message: multiple responses must all be mappings\") }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type in tool message: must be mapping, sequence of mappings, or string.\") }}\n {%- endif -%}\n {%- endif -%}\n {%- set ns.prev_message_type = 'tool_response' -%}\n {%- endif -%}\n {%- if ns.prev_message_type not in ['tool_call', 'tool_response'] -%}\n {{ '<end_of_turn>\\n' }}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {%- if ns.prev_message_type != 'tool_response' -%}\n {{- '<start_of_turn>model\\n' -}}\n {%- endif -%}\n{%- endif -%}\n"
|
| 51356 |
}
|
|
|
|
| 1107 |
"special": false
|
| 1108 |
},
|
| 1109 |
"138": {
|
| 1110 |
+
"content": "ββ",
|
| 1111 |
"lstrip": false,
|
| 1112 |
"normalized": false,
|
| 1113 |
"rstrip": false,
|
|
|
|
| 1115 |
"special": false
|
| 1116 |
},
|
| 1117 |
"139": {
|
| 1118 |
+
"content": "βββ",
|
| 1119 |
"lstrip": false,
|
| 1120 |
"normalized": false,
|
| 1121 |
"rstrip": false,
|
|
|
|
| 1123 |
"special": false
|
| 1124 |
},
|
| 1125 |
"140": {
|
| 1126 |
+
"content": "ββββ",
|
| 1127 |
"lstrip": false,
|
| 1128 |
"normalized": false,
|
| 1129 |
"rstrip": false,
|
|
|
|
| 1131 |
"special": false
|
| 1132 |
},
|
| 1133 |
"141": {
|
| 1134 |
+
"content": "βββββ",
|
| 1135 |
"lstrip": false,
|
| 1136 |
"normalized": false,
|
| 1137 |
"rstrip": false,
|
|
|
|
| 1139 |
"special": false
|
| 1140 |
},
|
| 1141 |
"142": {
|
| 1142 |
+
"content": "ββββββ",
|
| 1143 |
"lstrip": false,
|
| 1144 |
"normalized": false,
|
| 1145 |
"rstrip": false,
|
|
|
|
| 1147 |
"special": false
|
| 1148 |
},
|
| 1149 |
"143": {
|
| 1150 |
+
"content": "βββββββ",
|
| 1151 |
"lstrip": false,
|
| 1152 |
"normalized": false,
|
| 1153 |
"rstrip": false,
|
|
|
|
| 1155 |
"special": false
|
| 1156 |
},
|
| 1157 |
"144": {
|
| 1158 |
+
"content": "ββββββββ",
|
| 1159 |
"lstrip": false,
|
| 1160 |
"normalized": false,
|
| 1161 |
"rstrip": false,
|
|
|
|
| 1163 |
"special": false
|
| 1164 |
},
|
| 1165 |
"145": {
|
| 1166 |
+
"content": "βββββββββ",
|
| 1167 |
"lstrip": false,
|
| 1168 |
"normalized": false,
|
| 1169 |
"rstrip": false,
|
|
|
|
| 1171 |
"special": false
|
| 1172 |
},
|
| 1173 |
"146": {
|
| 1174 |
+
"content": "ββββββββββ",
|
| 1175 |
"lstrip": false,
|
| 1176 |
"normalized": false,
|
| 1177 |
"rstrip": false,
|
|
|
|
| 1179 |
"special": false
|
| 1180 |
},
|
| 1181 |
"147": {
|
| 1182 |
+
"content": "βββββββββββ",
|
| 1183 |
"lstrip": false,
|
| 1184 |
"normalized": false,
|
| 1185 |
"rstrip": false,
|
|
|
|
| 1187 |
"special": false
|
| 1188 |
},
|
| 1189 |
"148": {
|
| 1190 |
+
"content": "ββββββββββββ",
|
| 1191 |
"lstrip": false,
|
| 1192 |
"normalized": false,
|
| 1193 |
"rstrip": false,
|
|
|
|
| 1195 |
"special": false
|
| 1196 |
},
|
| 1197 |
"149": {
|
| 1198 |
+
"content": "βββββββββββββ",
|
| 1199 |
"lstrip": false,
|
| 1200 |
"normalized": false,
|
| 1201 |
"rstrip": false,
|
|
|
|
| 1203 |
"special": false
|
| 1204 |
},
|
| 1205 |
"150": {
|
| 1206 |
+
"content": "ββββββββββββββ",
|
| 1207 |
"lstrip": false,
|
| 1208 |
"normalized": false,
|
| 1209 |
"rstrip": false,
|
|
|
|
| 1211 |
"special": false
|
| 1212 |
},
|
| 1213 |
"151": {
|
| 1214 |
+
"content": "βββββββββββββββ",
|
| 1215 |
"lstrip": false,
|
| 1216 |
"normalized": false,
|
| 1217 |
"rstrip": false,
|
|
|
|
| 1219 |
"special": false
|
| 1220 |
},
|
| 1221 |
"152": {
|
| 1222 |
+
"content": "ββββββββββββββββ",
|
| 1223 |
"lstrip": false,
|
| 1224 |
"normalized": false,
|
| 1225 |
"rstrip": false,
|
|
|
|
| 1227 |
"special": false
|
| 1228 |
},
|
| 1229 |
"153": {
|
| 1230 |
+
"content": "βββββββββββββββββ",
|
| 1231 |
"lstrip": false,
|
| 1232 |
"normalized": false,
|
| 1233 |
"rstrip": false,
|
|
|
|
| 1235 |
"special": false
|
| 1236 |
},
|
| 1237 |
"154": {
|
| 1238 |
+
"content": "ββββββββββββββββββ",
|
| 1239 |
"lstrip": false,
|
| 1240 |
"normalized": false,
|
| 1241 |
"rstrip": false,
|
|
|
|
| 1243 |
"special": false
|
| 1244 |
},
|
| 1245 |
"155": {
|
| 1246 |
+
"content": "βββββββββββββββββββ",
|
| 1247 |
"lstrip": false,
|
| 1248 |
"normalized": false,
|
| 1249 |
"rstrip": false,
|
|
|
|
| 1251 |
"special": false
|
| 1252 |
},
|
| 1253 |
"156": {
|
| 1254 |
+
"content": "ββββββββββββββββββββ",
|
| 1255 |
"lstrip": false,
|
| 1256 |
"normalized": false,
|
| 1257 |
"rstrip": false,
|
|
|
|
| 1259 |
"special": false
|
| 1260 |
},
|
| 1261 |
"157": {
|
| 1262 |
+
"content": "βββββββββββββββββββββ",
|
| 1263 |
"lstrip": false,
|
| 1264 |
"normalized": false,
|
| 1265 |
"rstrip": false,
|
|
|
|
| 1267 |
"special": false
|
| 1268 |
},
|
| 1269 |
"158": {
|
| 1270 |
+
"content": "ββββββββββββββββββββββ",
|
| 1271 |
"lstrip": false,
|
| 1272 |
"normalized": false,
|
| 1273 |
"rstrip": false,
|
|
|
|
| 1275 |
"special": false
|
| 1276 |
},
|
| 1277 |
"159": {
|
| 1278 |
+
"content": "βββββββββββββββββββββββ",
|
| 1279 |
"lstrip": false,
|
| 1280 |
"normalized": false,
|
| 1281 |
"rstrip": false,
|
|
|
|
| 1283 |
"special": false
|
| 1284 |
},
|
| 1285 |
"160": {
|
| 1286 |
+
"content": "ββββββββββββββββββββββββ",
|
| 1287 |
"lstrip": false,
|
| 1288 |
"normalized": false,
|
| 1289 |
"rstrip": false,
|
|
|
|
| 1291 |
"special": false
|
| 1292 |
},
|
| 1293 |
"161": {
|
| 1294 |
+
"content": "βββββββββββββββββββββββββ",
|
| 1295 |
"lstrip": false,
|
| 1296 |
"normalized": false,
|
| 1297 |
"rstrip": false,
|
|
|
|
| 1299 |
"special": false
|
| 1300 |
},
|
| 1301 |
"162": {
|
| 1302 |
+
"content": "ββββββββββββββββββββββββββ",
|
| 1303 |
"lstrip": false,
|
| 1304 |
"normalized": false,
|
| 1305 |
"rstrip": false,
|
|
|
|
| 1307 |
"special": false
|
| 1308 |
},
|
| 1309 |
"163": {
|
| 1310 |
+
"content": "βββββββββββββββββββββββββββ",
|
| 1311 |
"lstrip": false,
|
| 1312 |
"normalized": false,
|
| 1313 |
"rstrip": false,
|
|
|
|
| 1315 |
"special": false
|
| 1316 |
},
|
| 1317 |
"164": {
|
| 1318 |
+
"content": "ββββββββββββββββββββββββββββ",
|
| 1319 |
"lstrip": false,
|
| 1320 |
"normalized": false,
|
| 1321 |
"rstrip": false,
|
|
|
|
| 1323 |
"special": false
|
| 1324 |
},
|
| 1325 |
"165": {
|
| 1326 |
+
"content": "βββββββββββββββββββββββββββββ",
|
| 1327 |
"lstrip": false,
|
| 1328 |
"normalized": false,
|
| 1329 |
"rstrip": false,
|
|
|
|
| 1331 |
"special": false
|
| 1332 |
},
|
| 1333 |
"166": {
|
| 1334 |
+
"content": "ββββββββββββββββββββββββββββββ",
|
| 1335 |
"lstrip": false,
|
| 1336 |
"normalized": false,
|
| 1337 |
"rstrip": false,
|
|
|
|
| 1339 |
"special": false
|
| 1340 |
},
|
| 1341 |
"167": {
|
| 1342 |
+
"content": "βββββββββββββββββββββββββββββββ",
|
| 1343 |
"lstrip": false,
|
| 1344 |
"normalized": false,
|
| 1345 |
"rstrip": false,
|
|
|
|
| 51352 |
"tokenizer_class": "GemmaTokenizerFast",
|
| 51353 |
"unk_token": "<unk>",
|
| 51354 |
"use_default_system_prompt": false,
|
| 51355 |
+
"chat_template": "{%- macro format_parameters(properties, required) -%}\n {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in properties | dictsort -%}\n {%- if key not in standard_keys -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {{- key }}:{description:<escape>{{ value['description'] }}<escape>\n {%- if value['type'] | upper == 'STRING' -%}\n {%- if value['enum'] -%}\n ,enum:{{ format_argument(value['enum']) }}\n {%- endif -%}\n {%- elif value['type'] | upper == 'OBJECT' -%}\n ,properties:{\n {%- if value['properties'] is defined and value['properties'] is mapping -%}\n {{- format_parameters(value['properties'], value['required'] | default([])) -}}\n {%- elif value is mapping -%}\n {{- format_parameters(value, value['required'] | default([])) -}}\n {%- endif -%}\n }\n {%- if value['required'] -%}\n ,required:[\n {%- for item in value['required'] | default([]) -%}\n <escape>{{- item -}}<escape>\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n ]\n {%- endif -%}\n {%- elif value['type'] | upper == 'ARRAY' -%}\n {%- if value['items'] is mapping and value['items'] -%}\n ,items:{\n {%- set ns_items = namespace(found_first=false) -%}\n {%- for item_key, item_value in value['items'] | dictsort -%}\n {%- if item_value is not none -%}\n {%- if ns_items.found_first %},{% endif -%}\n {%- set ns_items.found_first = true -%}\n {%- if item_key == 'properties' -%}\n properties:{\n {%- if item_value is mapping -%}\n {{- format_parameters(item_value, value['items']['required'] | default([])) -}}\n {%- endif -%}\n }\n {%- elif item_key == 'required' -%}\n required:[\n {%- for req_item in item_value -%}\n <escape>{{- req_item -}}<escape>\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n ]\n {%- elif item_key == 'type' -%}\n {%- if item_value is string -%}\n type:{{ format_argument(item_value | upper) }}\n {%- else -%}\n type:{{ format_argument(item_value | map('upper') | list) }}\n {%- endif -%}\n {%- else -%}\n {{ item_key }}:{{ format_argument(item_value) }}\n {%- endif -%}\n {%- endif -%}\n {%- endfor -%}\n }\n {%- endif -%}\n {%- endif -%}\n ,type:<escape>{{ value['type'] | upper }}<escape>}\n {%- endif -%}\n {%- endfor -%}\n{%- endmacro -%}\n{% macro format_function_declaration(tool_data) -%}\ndeclaration:{{- tool_data['function']['name'] -}}\n{description:<escape>{{- tool_data['function']['description'] -}}<escape>\n{%- set params = tool_data['function']['parameters'] -%}\n{%- if params -%}\n ,parameters:{\n {%- if params['properties'] -%}\n properties:{ {{- format_parameters(params['properties'], params['required']) -}} },\n {%- endif -%}\n {%- if params['required'] -%}\n required:[\n {%- for item in params['required'] -%}\n <escape>{{- item -}}<escape>\n {{- ',' if not loop.last -}}\n {%- endfor -%}\n ],\n {%- endif -%}\n {%- if params['type'] -%}\n type:<escape>{{- params['type'] | upper -}}<escape>}\n {%- endif -%}\n{%- endif -%}\n}\n{%- endmacro -%}\n{% macro format_argument(argument, escape_keys=True) -%}\n{%- if argument is string -%}\n {{- '<escape>' + argument + '<escape>' -}}\n{%- elif argument is boolean -%}\n {%- if argument -%}\n {{- 'true' -}}\n {%- else -%}\n {{- 'false' -}}\n {%- endif -%}\n{%- elif argument is mapping -%}\n {{- '{' -}}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in argument | dictsort -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {%- if escape_keys -%}\n {{- '<escape>' + key + '<escape>' -}}\n {%- else -%}\n {{- key -}}\n {%- endif -%}\n :{{- format_argument(value, escape_keys=escape_keys) -}}\n {%- endfor -%}\n {{- '}' -}}\n{%- elif argument is iterable -%}\n {{- '[' -}}\n {%- for item in argument -%}\n {{- format_argument(item, escape_keys=escape_keys) -}}\n {%- if not loop.last %},{% endif -%}\n {%- endfor -%}\n {{- ']' -}}\n{%- else -%}\n {{- argument -}}\n{%- endif -%}\n{%- endmacro -%}\n{{ bos_token }}\n{%- set ns = namespace(prev_message_type=None) -%}\n{#- Tool Declarations -#}\n{%- set loop_messages = messages -%}\n{%- if tools or messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}\n {{- '<start_of_turn>developer\\n' -}}\n {%- if messages[0]['role'] == 'system' or messages[0]['role'] == 'developer' -%}\n {%- if messages[0]['content'] is string -%}\n {{- messages[0]['content'] | trim -}}\n {%- elif messages[0]['content'] is iterable -%}\n {%- for item in messages[0]['content'] -%}\n {%- if item['type'] == 'text' -%}\n {{- item['text'] | trim -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n {%- endif -%}\n {%- if tools -%}\n {%- for tool in tools %}\n {{- '<start_function_declaration>' -}}\n {{- format_function_declaration(tool) | trim }}\n {{- '<end_function_declaration>' -}}\n {%- endfor %}\n {%- endif -%}\n {{- '<end_of_turn>\\n' }}\n{%- endif %}\n{#- Loop through messages. -#}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'assistant') -%}\n {#- Rename \"assistant\" to \"model\". -#}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {%- if role != 'tool' -%}\n {%- if ns.prev_message_type != 'tool_response' -%}\n {{- '<start_of_turn>' + role + '\\n' }}\n {%- endif -%}\n {%- set ns.prev_message_type = None -%}\n {%- if 'content' in message and message['content'] is not none -%}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type in user/assistant message\") }}\n {%- endif -%}\n {%- set ns.prev_message_type = 'content' -%}\n {%- endif -%}\n {%- if 'tool_calls' in message and message['tool_calls'] and message['tool_calls'] is iterable -%}\n {#- Tool Calls -#}\n {%- for tool_call in message['tool_calls'] -%}\n {% set function = tool_call['function'] %}\n {{- '<start_function_call>call:' + function['name'] + '{' -}}\n {%- if 'arguments' in function -%}\n {%- if function['arguments'] is mapping -%}\n {%- set ns = namespace(found_first=false) -%}\n {%- for key, value in function['arguments'] | dictsort -%}\n {%- if ns.found_first %},{% endif -%}\n {%- set ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {%- elif function['arguments'] is string -%}\n {# This handles string-JSON, just in case #}\n {{ function['arguments'] }}\n {%- endif %}\n {%- endif -%}\n {{- '}<end_function_call>' -}}\n {%- endfor -%}\n {%- if loop.last -%}\n {{ '<start_function_response>' }}\n {%- endif -%}\n {%- set ns.prev_message_type = 'tool_call' -%}\n {%- endif -%}\n {%- else -%}\n {#- Tool Responses -#}\n {%- if 'content' in message and message['content'] -%}\n {%- if message['content'] is mapping -%}\n {%- if 'name' in message['content'] and 'response' in message['content'] -%}\n {{ '<start_function_response>response:' + message['content']['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in message['content']['response'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- elif 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in message['content'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response mapping: must contain 'name' and 'response' keys, or 'name' must be in the message.\") }}\n {%- endif -%}\n {%- elif message['content'] is string -%}\n {%- if 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{value:' + format_argument(message['content'], escape_keys=False) + '}<end_function_response>' }}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response: 'name' must be provided.\") }}\n {%- endif -%}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item is mapping -%}\n {%- if 'name' in item and 'response' in item -%}\n {{ '<start_function_response>response:' + item['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in item['response'] | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- elif 'name' in message -%}\n {{ '<start_function_response>response:' + message['name'] | trim + '{' }}\n {%- set response_ns = namespace(found_first=false) -%}\n {%- for key, value in item | dictsort -%}\n {%- if response_ns.found_first %},{% endif -%}\n {%- set response_ns.found_first = true -%}\n {{- key -}}:{{- format_argument(value, escape_keys=False) -}}\n {%- endfor -%}\n {{- '}<end_function_response>' -}}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response mapping: must contain 'name' and 'response' keys, or 'name' must be in the message.\") }}\n {%- endif -%}\n {%- else -%}\n {{ raise_exception(\"Invalid tool response message: multiple responses must all be mappings\") }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type in tool message: must be mapping, sequence of mappings, or string.\") }}\n {%- endif -%}\n {%- endif -%}\n {%- set ns.prev_message_type = 'tool_response' -%}\n {%- endif -%}\n {%- if ns.prev_message_type not in ['tool_call', 'tool_response'] -%}\n {{ '<end_of_turn>\\n' }}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {%- if ns.prev_message_type != 'tool_response' -%}\n {{- '<start_of_turn>model\\n' -}}\n {%- endif -%}\n{%- endif -%}\n"
|
| 51356 |
}
|