Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Llama 3.1 chat template has <|begin_of_text|> encoded twice #3535

Open
horsten opened this issue Sep 25, 2024 · 0 comments
Open

Llama 3.1 chat template has <|begin_of_text|> encoded twice #3535

horsten opened this issue Sep 25, 2024 · 0 comments

Comments

@horsten
Copy link

horsten commented Sep 25, 2024

In conversation.py (my comment):

        elif self.sep_style == SeparatorStyle.LLAMA3:
            # No! It's already added in encode_dialog_prompt chat_format.py
            #ret = "<|begin_of_text|>"
            if self.system_message:
                ret += system_prompt

And in encode_dialog_prompt:

        tokens = []
        tokens.append(self.tokenizer.special_tokens["<|begin_of_text|>"])
        for message in messages:

Not sure which one to keep, but only one of them for sure.

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

No branches or pull requests

1 participant