chat template
#9
by
lucyknada
- opened
semi related to #8 but even statically replacing the placeholder for "today" or removing it, the template is still invalid across all backends, now my question is; is the old small template here: https://huggingface.co/mistralai/Mistral-Small-Instruct-2409/blob/8012044390bdc1c6d8ab162f5416220f43bf517b/tokenizer_config.json#L6176 an acceptable alternative for now? it seems to perform similarly and doesnt require hundreds of escapes, thank you!
here is my fix : Replace this at line 9010
"chat_template": "{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ '[INST]' + message['content'] + '[/INST]' }}{% elif message['role'] == 'system' %}{{ '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token }}{% else %}{{ raise_exception('Only user, system and assistant roles are supported!') }}{% endif %}{% endfor %}",