mpt-30b-chat-w8a8-gptq / chat_template.jinja
adamrb's picture
Upload w8a8 version of MPT-30B-Chat
03d6b4a verified
raw
history blame contribute delete
943 Bytes
{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif not 'system' in messages[0]['role'] %}{% set loop_messages = messages %}{% set system_message = 'A conversation between a user and an LLM-based AI assistant. The assistant gives helpful and honest answers.' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if loop.index0 == 0 %}{% if system_message != false %}{{ '<|im_start|>system
' + system_message.strip() + '
'}}{% endif %}{{ '<|im_start|>' + message['role'] + '
' + message['content'] + '<|im_end|>' }}{% else %}{{ '
' + '<|im_start|>' + message['role'] + '
' + message['content'] + '<|im_end|>' }}{% endif %}{% if (add_generation_prompt == true and loop.last) %}{{ '
' + '<|im_start|>' + 'assistant' + '
' }}{% elif (message['role'] == 'assistant') %}{% endif %}{% endfor %}