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

[jinja] GPT4All-Chat 3.6.1 google/gemma-2-2b-it #3344

Open
ThiloteE opened this issue Dec 22, 2024 · 0 comments
Open

[jinja] GPT4All-Chat 3.6.1 google/gemma-2-2b-it #3344

ThiloteE opened this issue Dec 22, 2024 · 0 comments
Labels

Comments

@ThiloteE
Copy link
Collaborator

ThiloteE commented Dec 22, 2024

Meta-issue: #3340

Bug Report

Model does not work out of the box

Steps to Reproduce

  1. Download the gguf, sideload it in GPT4All-Chat, start chatting

Expected Behavior

Model works out of the box.

Your Environment

Original Jinja template in tokenizer_config.json (taken from unsloth/gemma-2-2b-it)

{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}

Jinja template out of the box in GPT4All-Chat 3.6.1, but still has EOS issues:

{{- bos_token }}
{%- if messages[0]['role'] == 'system' %}
    {{- raise_exception('System role not supported') }}
{%- endif %}
{%- for message in messages %}
    {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
        {{- raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
    {%- endif %}
    {%- if message['role'] == 'assistant' %}
        {%- set role = 'model' %}
    {%- else %}
        {%- set role = message['role'] %}
    {%- endif %}
    {{- '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}
{%- endfor %}
{%- if add_generation_prompt %}
    {{- '<start_of_turn>model\n' }}
{%- endif %}

Image

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

No branches or pull requests

1 participant