Update chat_template (#4)
- Update chat_template (44bf2153ffe7ee35988c1096b2cb3cd9690158bb) Co-authored-by: Joshua <Xenova@users.noreply.huggingface.co>
This commit is contained in:
parent
6c0ce4ee32
commit
ca8476f4df
@ -3,9 +3,8 @@ license: gemma
|
|||||||
library_name: transformers
|
library_name: transformers
|
||||||
pipeline_tag: text-generation
|
pipeline_tag: text-generation
|
||||||
extra_gated_heading: Access Gemma on Hugging Face
|
extra_gated_heading: Access Gemma on Hugging Face
|
||||||
extra_gated_prompt: >-
|
extra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and
|
||||||
To access Gemma on Hugging Face, you’re required to review and agree to
|
agree to Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
||||||
Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
|
||||||
Face and click below. Requests are processed immediately.
|
Face and click below. Requests are processed immediately.
|
||||||
extra_gated_button_content: Acknowledge license
|
extra_gated_button_content: Acknowledge license
|
||||||
base_model: google/gemma-3-1b-pt
|
base_model: google/gemma-3-1b-pt
|
||||||
|
|||||||
BIN
tokenizer.json
(Stored with Git LFS)
BIN
tokenizer.json
(Stored with Git LFS)
Binary file not shown.
@ -2160,7 +2160,7 @@
|
|||||||
"normalized": false,
|
"normalized": false,
|
||||||
"rstrip": false,
|
"rstrip": false,
|
||||||
"single_word": false,
|
"single_word": false,
|
||||||
"special": false
|
"special": true
|
||||||
},
|
},
|
||||||
"256000": {
|
"256000": {
|
||||||
"content": "<end_of_image>",
|
"content": "<end_of_image>",
|
||||||
@ -2168,7 +2168,7 @@
|
|||||||
"normalized": false,
|
"normalized": false,
|
||||||
"rstrip": false,
|
"rstrip": false,
|
||||||
"single_word": false,
|
"single_word": false,
|
||||||
"special": false
|
"special": true
|
||||||
},
|
},
|
||||||
"256001": {
|
"256001": {
|
||||||
"content": "<unused99>",
|
"content": "<unused99>",
|
||||||
@ -51325,7 +51325,7 @@
|
|||||||
},
|
},
|
||||||
"boi_token": "<start_of_image>",
|
"boi_token": "<start_of_image>",
|
||||||
"bos_token": "<bos>",
|
"bos_token": "<bos>",
|
||||||
"chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\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\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n",
|
"chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\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\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n",
|
||||||
"clean_up_tokenization_spaces": false,
|
"clean_up_tokenization_spaces": false,
|
||||||
"eoi_token": "<end_of_image>",
|
"eoi_token": "<end_of_image>",
|
||||||
"eos_token": "<eos>",
|
"eos_token": "<eos>",
|
||||||
@ -51337,6 +51337,7 @@
|
|||||||
"image_token": "<image_soft_token>",
|
"image_token": "<image_soft_token>",
|
||||||
"model_max_length": 1000000000000000019884624838656,
|
"model_max_length": 1000000000000000019884624838656,
|
||||||
"pad_token": "<pad>",
|
"pad_token": "<pad>",
|
||||||
|
"processor_class": "Gemma3Processor",
|
||||||
"sp_model_kwargs": null,
|
"sp_model_kwargs": null,
|
||||||
"spaces_between_special_tokens": false,
|
"spaces_between_special_tokens": false,
|
||||||
"tokenizer_class": "GemmaTokenizer",
|
"tokenizer_class": "GemmaTokenizer",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user