Fix bos/eos token IDs + add enable_thinking to chat template

#4
by KristianS7 - opened
Files changed (2) hide show
  1. config.json +3 -3
  2. tokenizer_config.json +3 -3
config.json CHANGED
@@ -8,8 +8,8 @@
8
  "AutoModelForCausalLM": "modeling_ouro.OuroForCausalLM",
9
  "AutoModel": "modeling_ouro.OuroModel"
10
  },
11
- "bos_token_id": 0,
12
- "eos_token_id": 0,
13
  "head_dim": 128,
14
  "hidden_act": "silu",
15
  "hidden_size": 2048,
@@ -59,4 +59,4 @@
59
  "use_cache": true,
60
  "use_sliding_window": false,
61
  "vocab_size": 49152
62
- }
 
8
  "AutoModelForCausalLM": "modeling_ouro.OuroForCausalLM",
9
  "AutoModel": "modeling_ouro.OuroModel"
10
  },
11
+ "bos_token_id": 1,
12
+ "eos_token_id": 2,
13
  "head_dim": 128,
14
  "hidden_act": "silu",
15
  "hidden_size": 2048,
 
59
  "use_cache": true,
60
  "use_sliding_window": false,
61
  "vocab_size": 49152
62
+ }
tokenizer_config.json CHANGED
@@ -157,8 +157,8 @@
157
  "<jupyter_script>",
158
  "<empty_output>"
159
  ],
160
- "bos_token": "<|endoftext|>",
161
- "chat_template": "{%- if messages[0]['role'] == 'system' -%}{{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}{%- else -%}{{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}{%- endif -%}{%- for message in messages -%}{%- if message.role == 'system' and loop.first -%}{# Skip #}{%- else -%}{{- '<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|im_start|>assistant\\n' }}{%- endif -%}",
162
  "clean_up_tokenization_spaces": false,
163
  "eos_token": "<|im_end|>",
164
  "extra_special_tokens": {},
@@ -169,4 +169,4 @@
169
  "tokenizer_class": "GPT2Tokenizer",
170
  "unk_token": "<|endoftext|>",
171
  "vocab_size": 49152
172
- }
 
157
  "<jupyter_script>",
158
  "<empty_output>"
159
  ],
160
+ "bos_token": "<|im_start|>",
161
+ "chat_template": "{%- if messages[0]['role'] == 'system' -%}{{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}{%- else -%}{{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}{%- endif -%}{%- for message in messages -%}{%- if message.role == 'system' and loop.first -%}{# Skip #}{%- else -%}{{- '<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|im_start|>assistant\\n' }}{%- if enable_thinking is defined and enable_thinking is true -%}{{- '<think>\\n' }}{%- endif -%}{%- endif -%}",
162
  "clean_up_tokenization_spaces": false,
163
  "eos_token": "<|im_end|>",
164
  "extra_special_tokens": {},
 
169
  "tokenizer_class": "GPT2Tokenizer",
170
  "unk_token": "<|endoftext|>",
171
  "vocab_size": 49152
172
+ }