Hi @Rocketknight1 is see that you added the chat_template data for the LlaMA-2 models. There appears to be a bug in that logic where if you only pass in a system prompt, formatting the template returns an empty string/list. For example, the below code results in printing an empty string:
chat = [
{"role": "system", "content": "You are a helpful and honest assistant."},
]
print(tokenizer.apply_chat_template(chat, tokenize=False))
However, if you edit it to have an empty user object, then it will output the system prompt with the empty user input (which in llaMA comes with an appended â[/INST]â
chat = [
{"role": "system", "content": "You are a helpful and honest assistant."},
{"role": "user", "content": ""},
]
print(tokenizer.apply_chat_template(chat, tokenize=False))
This is a problem for scenarious where I only want to retrieve the LlaMA formatted system prompt.
Another miscellaneous comment is that the link for the chat_completion template in meta-llama/Llama-2-13b-chat-hf ¡ Hugging Face points to
chat_completion
which I think should now point to line 284, not 212.
Overall, love the addition of chat templates and I look forward to increasing their usage in my codebase!