Files
blood-donation-gemma3-1bb-m…/chat_template.jinja

11 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
' + messages[0]['content'] + '<|eot_id|>' }}{% set loop_messages = messages[1:] %}{% else %}{{ '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful and knowledgeable blood donation advisor serving Tanzania. You answer questions accurately and concisely in both English and Swahili (Kiswahili). IMPORTANT: Always respond in the same language the user writes in. If the user writes in Swahili, respond fully in Swahili. If the user writes in English, respond in English. Never switch languages mid-response unless the user does so first.<|eot_id|>' }}{% set loop_messages = messages %}{% endif %}{% for message in loop_messages %}{% if message['role'] == 'user' %}{{ '<|start_header_id|>user<|end_header_id|>
' + message['content'] }}{% elif message['role'] == 'assistant' %}{{ '<|eot_id|><|start_header_id|>assistant<|end_header_id|>
' + message['content'] + '<|eot_id|><end_of_turn>' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|eot_id|><|start_header_id|>assistant<|end_header_id|>
' }}{% endif %}