prince-canuma commited on
Commit
cd825a9
1 Parent(s): e2d670a

Upload tokenizer

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +1 -1
tokenizer_config.json CHANGED
@@ -306,7 +306,7 @@
306
  ]
307
  },
308
  "bos_token": "<BOS_TOKEN>",
309
- "chat_template": "{% for item in messages %}{% if item.role == 'system' %}<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ item.content }}<|END_OF_TURN_TOKEN|>\n{% elif item.role == 'user' %}<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ item.content }}<|END_OF_TURN_TOKEN|>\n{% endif %}{% if loop.last %}{% if add_generation_prompt %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% endif %}{% endif %}{% endfor %}",
310
  "clean_up_tokenization_spaces": false,
311
  "eos_token": "<|END_OF_TURN_TOKEN|>",
312
  "legacy": true,
 
306
  ]
307
  },
308
  "bos_token": "<BOS_TOKEN>",
309
+ "chat_template": "<BOS_TOKEN>{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message.role == 'user' %}<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n{% elif message.role == 'assistant' %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{% endif %}{% endfor %}{% if add_generation_prompt %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% endif %}",
310
  "clean_up_tokenization_spaces": false,
311
  "eos_token": "<|END_OF_TURN_TOKEN|>",
312
  "legacy": true,