Difference in chat templates between Phi-3-small-8k-instruct and Phi-3-medium-4k-instruct

#4
by tanliboy - opened

In the microsoft/Phi-3-small-8k-instruct model, there is a leading BOS token

"chat_template": "{{ bos_token }}{% for message in messages %}{{'<|' + message['role'] + '|>' + '\n' + message['content'] + '<|end|>\n' }}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>\n' }}{% else %}{{ eos_token }}{% endif %}"

whereas in this repository, it is removed and there is also a lack of add_generation_prompt.

"chat_template": "{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + '\n' + message['content'] + '<|end|>' + '\n' + '<|assistant|>' + '\n'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + '\n'}}{% endif %}{% endfor %}"

Is there any reason on it? Thanks!

Microsoft org

Thanks for your interest! Small and Medium are different models. It is recommended to follow the format in the model card.

nguyenbh changed discussion status to closed

Sign up or log in to comment