update chat_template and tokenizer_config.json to be compatible with transformers (#80)
Browse files- update (08bbcbdb905ecbc91ac04b53e9f548f38f028a3d)
- chat_template.jinja +1 -4
- config.json +1 -0
- tokenizer_config.json +1 -0
chat_template.jinja
CHANGED
|
@@ -7,16 +7,13 @@
|
|
| 7 |
{%- if not eos_token is defined -%}
|
| 8 |
{%- set eos_token = "</s>" -%}
|
| 9 |
{%- endif -%}
|
| 10 |
-
{%- if not image_token is defined -%}
|
| 11 |
-
{%- set image_token = "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>" -%}
|
| 12 |
-
{%- endif -%}
|
| 13 |
{{- cls_token -}}
|
| 14 |
{%- for message in messages -%}
|
| 15 |
{%- if message["role"] == "user" -%}
|
| 16 |
{{- "User: " -}}
|
| 17 |
{%- for content in message["content"] -%}
|
| 18 |
{%- if content["type"] == "image" -%}
|
| 19 |
-
{{
|
| 20 |
{%- endif -%}
|
| 21 |
{%- endfor -%}
|
| 22 |
{%- for content in message["content"] -%}
|
|
|
|
| 7 |
{%- if not eos_token is defined -%}
|
| 8 |
{%- set eos_token = "</s>" -%}
|
| 9 |
{%- endif -%}
|
|
|
|
|
|
|
|
|
|
| 10 |
{{- cls_token -}}
|
| 11 |
{%- for message in messages -%}
|
| 12 |
{%- if message["role"] == "user" -%}
|
| 13 |
{{- "User: " -}}
|
| 14 |
{%- for content in message["content"] -%}
|
| 15 |
{%- if content["type"] == "image" -%}
|
| 16 |
+
{{ "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>" }}
|
| 17 |
{%- endif -%}
|
| 18 |
{%- endfor -%}
|
| 19 |
{%- for content in message["content"] -%}
|
config.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
| 68 |
"torch_dtype": "bfloat16"
|
| 69 |
},
|
| 70 |
"vision_start_token_id": 101305,
|
|
|
|
| 71 |
"vocab_size": 103424,
|
| 72 |
"weight_share_add_bias": true,
|
| 73 |
"use_3d_rope": true,
|
|
|
|
| 68 |
"torch_dtype": "bfloat16"
|
| 69 |
},
|
| 70 |
"vision_start_token_id": 101305,
|
| 71 |
+
"vision_end_token_id": 101306,
|
| 72 |
"vocab_size": 103424,
|
| 73 |
"weight_share_add_bias": true,
|
| 74 |
"use_3d_rope": true,
|
tokenizer_config.json
CHANGED
|
@@ -8330,6 +8330,7 @@
|
|
| 8330 |
"clean_up_tokenization_spaces": false,
|
| 8331 |
"cls_token": "<|begin_of_sentence|>",
|
| 8332 |
"eos_token": "</s>",
|
|
|
|
| 8333 |
"extra_special_tokens": {},
|
| 8334 |
"legacy": true,
|
| 8335 |
"mask_token": "<mask:1>",
|
|
|
|
| 8330 |
"clean_up_tokenization_spaces": false,
|
| 8331 |
"cls_token": "<|begin_of_sentence|>",
|
| 8332 |
"eos_token": "</s>",
|
| 8333 |
+
"image_token": "<|IMAGE_PLACEHOLDER|>",
|
| 8334 |
"extra_special_tokens": {},
|
| 8335 |
"legacy": true,
|
| 8336 |
"mask_token": "<mask:1>",
|