Skip to content

How the system_message in get_chat_template works? #989

Closed

Description

@oscar66oliver

I add the parameter like this.
image
but the final text is
image
Is the system_message useful? How can I see the final system_message that is thrown into the model? Thank you much!

Activity

  1. danielhanchen commented on Sep 10, 2024

    @danielhanchen
    Member

    Sorry on the delay! Yep that's Llama 3.1's default system instruction!

    But interesting on why dfffff did not show up - let me fix this - sorry on the issue!

  2. KuroKienDinh commented on Nov 5, 2024

    @KuroKienDinh

    @danielhanchen Hi, did you fix this error? I face same error, can't add my custom system_message when calling get_chat_template

    Thanks!

  3. danielhanchen commented on Nov 5, 2024

    @danielhanchen
    Member

    @Erland366 would you be able to look into this - thanks :)

  4. Erland366 commented on Nov 5, 2024

    @Erland366
    Collaborator

    will check them

  5. KuroKienDinh commented on Nov 6, 2024

    @KuroKienDinh

    @Erland366 After reviewing and running code with your new file chat_templates.py it show error at line 892.
    I also fixed by replace str | None to str=None and no error but when input system_messsage it doesn't work.
    I use qwen2.5 model.

  6. Erland366 commented on Nov 6, 2024

    @Erland366
    Collaborator

    @tadinhkien99 Oh sorry for the type hinting. now it's removed

    Can I see what's your input? because I tested mine and it works .-.
    image

  7. KuroKienDinh commented on Nov 6, 2024

    @KuroKienDinh

    @Erland366 I just tried again and it works on my end. It seems there might be some residual spaces at the end (|im_end|). Could you please check and let me know if that resolves the issue?
    image
    Thanks!

  8. Erland366 commented on Nov 6, 2024

    @Erland366
    Collaborator

    image

    Not happening in my case tho .-. this is weird

    I suspect maybe if user call get_chat_template twice using the same tokenizer then these weird behavior appear .-.

    Will check it later tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    URGENT BUGcurrently fixing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions