Skip to content

Conversation

TK-21st
Copy link

@TK-21st TK-21st commented Jan 25, 2025

Changes

Use tokenizer.chat_template (if exists) for instruction type tasks by default.

Issue Addressed

This address the issue for models such as google/gemma-2-2b-it, where the instruction tokens are

--instruction_tokens "<start_of_turn>user\n","<end_of_turn>\n","<start_of_turn>model\n"

However, in the current implementation, because of string escaping, the prompt template escapes \n to \\n, which makes the final template different from the model's actual template. Additionally the current implementation doesn't add <bos> for tokenizers that use them by default.

Notes

Only tested on instruct-humaneval for google/gemma-2-2b-it and meta-llama/Llama-3.2-1B-Instruct for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant