The chat prompt template for google/gemma-3-270m-it omits the system message.
Author: umang-0801
Pull request: no
Labels: name: bug

### System Info

Objective: To use [`google/gemma-3-270m-it`](https://huggingface.co/google/gemma-3-270m-it) for a chat application. 

Problem Description: The tokenizer provides a `apply_chat_template` function which 
1. Fails to include the system message in the prompt template with the right tag. 

To reproduce this issue:

**Environment details:**
- `transformers` version: 4.56.1
- Platform: Linux-6.1.123+-x86_64-with-glibc2.35
- Python version: 3.12.11
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: 1.10.1
- Accelerate config: 	not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.8.0+cu126 (NA)
- Tensorflow version (GPU?): 2.19.0 (False)
- Flax version (CPU?/GPU?/TPU?): 0.10.6 (cpu)
- Jax version: 0.5.3
- JaxLib version: 0.5.3


### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

```
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", dtype=torch.bfloat16)


messages = [
    {"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"},
    {"role": "user", "content": "How many helicopters can a human eat in one sitting?"}
 ]

print(tokenizer.apply_chat_template(messages, tokenize=False))

```
Output
```
<bos><start_of_turn>user
You are a friendly chatbot who always responds in the style of a pirate

How many helicopters can a human eat in one sitting?<end_of_turn>
```

### Expected behavior

Output
```
<start_of_turn>system
You are a friendly chatbot who always responds in the style of a pirate<end_of_turn>
<start_of_turn>user
How many helicopters can a human eat in one sitting?<end_of_turn>
```

Comments:
The same output came from tokenizers for all gemma3 family `gemma-3-1b-it`, `gemma-3-4b-it`, `gemma-3-12b-it`, `gemma-3-27b-it`. All of them produce
```
<bos><start_of_turn>user
You are a friendly chatbot who always responds in the style of a pirate

How many helicopters can a human eat in one sitting?<end_of_turn>
```
So I think this is designed intentionally (not sure)

@umang-0801 here is the template for gemma3-270
Yes the template prepend the system message to the first message, so it's not an issue, this is their design
```
{{ bos_token }}
{%- if messages[0]['role'] == 'system' -%}
    {%- if messages[0]['content'] is string -%}
        {%- set first_user_prefix = messages[0]['content'] + '

' -%}
    {%- else -%}
        {%- set first_user_prefix = messages[0]['content'][0]['text'] + '

' -%}
    {%- endif -%}
    {%- set loop_messages = messages[1:] -%}
{%- else -%}
    {%- set first_user_prefix = "" -%}
    {%- set loop_messages = messages -%}
{%- endif -%}
{%- for message in loop_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 + '
' + (first_user_prefix if loop.first else "") }}
    {%- if message['content'] is string -%}
        {{ message['content'] | trim }}
    {%- elif message['content'] is iterable -%}
        {%- for item in message['content'] -%}
            {%- if item['type'] == 'image' -%}
                {{ '<start_of_image>' }}
            {%- elif item['type'] == 'text' -%}
                {{ item['text'] | trim }}
            {%- endif -%}
        {%- endfor -%}
    {%- else -%}
        {{ raise_exception("Invalid content type") }}
    {%- endif -%}
    {{ '<end_of_turn>
' }}
{%- endfor -%}
{%- if add_generation_prompt -%}
    {{'<start_of_turn>model
'}}
{%- endif -%}
```

This should be closed, This gemma is designed to use only user prompts and no system prompts.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.