djuna commited on
Commit
1d6c53a
1 Parent(s): 605cf03

trim whitespaces

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +1 -1
tokenizer_config.json CHANGED
@@ -1744,7 +1744,7 @@
1744
  "<end_of_turn>"
1745
  ],
1746
  "bos_token": "<bos>",
1747
- "chat_template": "{{ bos_token }}{% for message in messages %}{% set system_adjust = 0 if loop.index0 == 0 and message['role'] != 'system' else 0 %}{% if loop.index0 == 0 and message['role'] == 'system' %}{{ '<start_of_turn>user\n'+message['content']+'\n'}}{% if messages | length > 1 and messages[1]['role'] == 'user' %}{{ messages[1]['content'] }}{% elif messages | length > 1 %}{{ raise_exception('Error: Expected user role after system role.') }}{% endif %}{{ '<end_of_turn>\n' }}{% elif loop.index0 == 1 and message['role'] == 'user' and messages[0]['role'] == 'system' %}{% else %}{% set role = 'model' if message['role'] == 'assistant' else message['role'] %}{% if loop.index0 <= 1 or messages[loop.index0 - 1]['role'] != role %}{{ '<start_of_turn>' }}{{ role }}{{ '\n'+message['content'] }}{{ '<end_of_turn>'+'\n' }}{% elif loop.index0 > 1 %}{{ raise_exception('Error: Consecutive messages with the same role are not allowed.') }}{% endif %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model'}}{% endif %}",
1748
  "clean_up_tokenization_spaces": false,
1749
  "eos_token": "<eos>",
1750
  "max_length": null,
 
1744
  "<end_of_turn>"
1745
  ],
1746
  "bos_token": "<bos>",
1747
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% set system_adjust = 0 if loop.index0 == 0 and message['role'] != 'system' else 0 %}{% if loop.index0 == 0 and message['role'] == 'system' %}{{ '<start_of_turn>user\n'+message['content'] | trim +'\n'}}{% if messages | length > 1 and messages[1]['role'] == 'user' %}{{ messages[1]['content'] | trim }}{% elif messages | length > 1 %}{{ raise_exception('Error: Expected user role after system role.') }}{% endif %}{{ '<end_of_turn>\n' }}{% elif loop.index0 == 1 and message['role'] == 'user' and messages[0]['role'] == 'system' %}{% else %}{% set role = 'model' if message['role'] == 'assistant' else message['role'] %}{% if loop.index0 <= 1 or messages[loop.index0 - 1]['role'] != role %}{{ '<start_of_turn>' }}{{ role }}{{ '\n'+message['content'] | trim }}{{ '<end_of_turn>'+'\n' }}{% elif loop.index0 > 1 %}{{ raise_exception('Error: Consecutive messages with the same role are not allowed.') }}{% endif %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model'}}{% endif %}",
1748
  "clean_up_tokenization_spaces": false,
1749
  "eos_token": "<eos>",
1750
  "max_length": null,