[GH-ISSUE #2636] [Model request] Google Gemma #79237

Closed
opened 2026-05-09 04:23:12 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @kylemclaren on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2636

Add Gemma family of models: https://huggingface.co/collections/google/gemma-release-65d5efbccdbb8c4202ec078b

Originally created by @kylemclaren on GitHub (Feb 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2636 Add Gemma family of models: https://huggingface.co/collections/google/gemma-release-65d5efbccdbb8c4202ec078b
Author
Owner

@nps798 commented on GitHub (Feb 21, 2024):

Curious, What's the correct TEMPLATE parameter for google gemma model, in the context of modelfile? I am converting GGUF to ollama by myself by using the command "ollama crea xxx -f xxx"

the original hugingface repo chat_template is as follows

{% 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 %}
<!-- gh-comment-id:1957025970 --> @nps798 commented on GitHub (Feb 21, 2024): Curious, What's the correct TEMPLATE parameter for google gemma model, in the context of modelfile? I am converting GGUF to ollama by myself by using the command "ollama crea xxx -f xxx" the original hugingface repo chat_template is as follows ``` {% 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 %} ```
Author
Owner

@bwasti commented on GitHub (Feb 21, 2024):

looks like it was added 11 hours ago? https://github.com/ollama/ollama/releases

it does seem to be a bit buggy, though (jumps into different languages...)

Screenshot 2024-02-21 at 10 57 21 AM
<!-- gh-comment-id:1957081214 --> @bwasti commented on GitHub (Feb 21, 2024): looks like it was added 11 hours ago? https://github.com/ollama/ollama/releases it does seem to be a bit buggy, though (jumps into different languages...) <img width="1512" alt="Screenshot 2024-02-21 at 10 57 21 AM" src="https://github.com/ollama/ollama/assets/4842908/474eb781-d239-4092-a5c0-984e1c212262">
Author
Owner

@kiang commented on GitHub (Feb 21, 2024):

buggy +1 when trying the 7b model using Chinese.
螢幕快照 2024-02-22 02-23-03

Some Chinese characters were broken in the response. And it looked like being inserted some programming code.

But anyway the English interaction is good.

<!-- gh-comment-id:1957632234 --> @kiang commented on GitHub (Feb 21, 2024): buggy +1 when trying the 7b model using Chinese. ![螢幕快照 2024-02-22 02-23-03](https://github.com/ollama/ollama/assets/47844/ecf2bf8e-8199-418c-b364-63106d5f4ffc) Some Chinese characters were broken in the response. And it looked like being inserted some programming code. But anyway the English interaction is good.
Author
Owner

@kylemclaren commented on GitHub (Feb 21, 2024):

Thanks @bwasti didn’t see that as it was pre-release when I looked.

<!-- gh-comment-id:1957705300 --> @kylemclaren commented on GitHub (Feb 21, 2024): Thanks @bwasti didn’t see that as it was pre-release when I looked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#79237