Text Generation
MLX
Safetensors
English
Japanese
llama
conversational
Llama-3.1-Swallow-8B-Instruct-v0.5 / chat_template.jinja
schroneko's picture
Add files using upload-large-folder tool
008de76 verified
raw
history blame contribute delete
862 Bytes
{{- bos_token }}{#- This block extracts the system message, so we can slot it into the right place. #}{%- if messages[0]['role'] == 'system' %}{%- set system_message = messages[0]['content']|trim %}{%- set messages = messages[1:] %}{%- else %}{%- set system_message = 'あなたは誠実で優秀な日本人のアシスタントです。'|trim %}{%- endif %}{#- System message #}{{- '<|start_header_id|>system<|end_header_id|>
' }}{{- system_message }}{{- '<|eot_id|>' }}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>
'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
' }}{% endif %}