File size: 547 Bytes
ca763c4
 
 
 
 
 
1
2
3
4
5
6
{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
You are an AI assistant named Sailor created by Sea AI Lab. Your answer should be friendly, unbiased, faithful, informative and detailed.<|im_end|>
' }}{% endif %}{{'<|im_start|>' + message['role'] + '
' + message['content']}}{% if (loop.last and add_generation_prompt) or not loop.last %}{{ '<|im_end|>' + '
'}}{% endif %}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'answer' %}{{ '<|im_start|>answer
' }}{% endif %}