Commit
•
0dbc5f3
1
Parent(s):
046a989
Upload processor
Browse files- chat_template.json +3 -0
- special_tokens_map.json +21 -3
- tokenizer_config.json +4 -1
chat_template.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"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\n{{- bos_token }}\n{%- for message in loop_messages %}\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 {%- if message[\"role\"] == \"user\" %}\n {%- if loop.last and system_message is defined %}\n {{- \"[INST]\" + system_message + \"\n\n\" }}\n {%- else %}\n {{- \"[INST]\" }}\n {%- endif %}\n {%- if message[\"content\"] is not string %}\n {%- for chunk in message[\"content\"] %}\n {%- if chunk[\"type\"] == \"text\" %}\n {{- chunk[\"content\"] }}\n {%- elif chunk[\"type\"] == \"image\" %}\n {{- \"[IMG]\" }}\n {%- else %}\n {{- raise_exception(\"Unrecognized content type!\") }}\n {%- endif %}\n {%- endfor %}\n {%- else %}\n {{- message[\"content\"] }}\n {%- endif %}\n {{- \"[/INST]\" }}\n {%- elif message[\"role\"] == \"assistant\" %}\n {{- message[\"content\"] + eos_token}}\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 %}"
|
3 |
+
}
|
special_tokens_map.json
CHANGED
@@ -1,5 +1,23 @@
|
|
1 |
{
|
2 |
-
"bos_token":
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
|
|
1 |
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
}
|
tokenizer_config.json
CHANGED
@@ -8004,9 +8004,12 @@
|
|
8004 |
"bos_token": "<s>",
|
8005 |
"clean_up_tokenization_spaces": true,
|
8006 |
"eos_token": "</s>",
|
|
|
|
|
|
|
|
|
8007 |
"model_max_length": 1000000000000000019884624838656,
|
8008 |
"processor_class": "PixtralProcessor",
|
8009 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
8010 |
-
"model_input_names": ["input_ids", "attention_mask"],
|
8011 |
"unk_token": "<unk>"
|
8012 |
}
|
|
|
8004 |
"bos_token": "<s>",
|
8005 |
"clean_up_tokenization_spaces": true,
|
8006 |
"eos_token": "</s>",
|
8007 |
+
"model_input_names": [
|
8008 |
+
"input_ids",
|
8009 |
+
"attention_mask"
|
8010 |
+
],
|
8011 |
"model_max_length": 1000000000000000019884624838656,
|
8012 |
"processor_class": "PixtralProcessor",
|
8013 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
|
|
8014 |
"unk_token": "<unk>"
|
8015 |
}
|