Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +45 -0
- added_tokens.json +3 -0
- chat_template.jinja +52 -0
- config.json +55 -0
- generation_config.json +14 -0
- model.safetensors +3 -0
- special_tokens_map.json +33 -0
- tokenizer.json +3 -0
- tokenizer.model +3 -0
- tokenizer_config.json +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- gg-hf-gm/gemma-3-270m-it
|
4 |
+
license: gemma
|
5 |
+
tags:
|
6 |
+
- gemma3
|
7 |
+
- unsloth
|
8 |
+
- gemma
|
9 |
+
- google
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
library_name: transformers
|
12 |
+
extra_gated_heading: Access Gemma on Hugging Face
|
13 |
+
extra_gated_prompt: >-
|
14 |
+
To access Gemma on Hugging Face, you’re required to review and agree to
|
15 |
+
Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
16 |
+
Face and click below. Requests are processed immediately.
|
17 |
+
extra_gated_button_content: Acknowledge license
|
18 |
+
---
|
19 |
+
<div>
|
20 |
+
<p style="margin-top: 0;margin-bottom: 0;">
|
21 |
+
<em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
|
22 |
+
</p>
|
23 |
+
<div style="display: flex; gap: 5px; align-items: center; ">
|
24 |
+
<a href="https://github.com/unslothai/unsloth/">
|
25 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
|
26 |
+
</a>
|
27 |
+
<a href="https://discord.gg/unsloth">
|
28 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
29 |
+
</a>
|
30 |
+
<a href="https://docs.unsloth.ai/">
|
31 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
32 |
+
</a>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
|
37 |
+
# Gemma 3 model card
|
38 |
+
|
39 |
+
> [!Note]
|
40 |
+
> This repository corresponds to the 270m **pre-trained** version of the Gemma 3 model using Quantization Aware Training (QAT).
|
41 |
+
>
|
42 |
+
> **The checkpoint in this repository is unquantized, please make sure to quantize with Q4_0 with your favorite tool**
|
43 |
+
>
|
44 |
+
> Thanks to QAT, the model is able to preserve similar quality as `bfloat16` while significantly reducing the memory requirements
|
45 |
+
> to load the model.
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<image_soft_token>": 262144
|
3 |
+
}
|
chat_template.jinja
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{# Copyright 2025-present Unsloth. Apache 2.0 License. Unsloth Chat template fixes #}
|
2 |
+
{{ bos_token }}
|
3 |
+
{%- if messages[0]['role'] == 'system' -%}
|
4 |
+
{%- if messages[0]['content'] is string -%}
|
5 |
+
{%- set first_user_prefix = messages[0]['content'] + '
|
6 |
+
|
7 |
+
' -%}
|
8 |
+
{%- else -%}
|
9 |
+
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
|
10 |
+
|
11 |
+
' -%}
|
12 |
+
{%- endif -%}
|
13 |
+
{%- set loop_messages = messages[1:] -%}
|
14 |
+
{%- else -%}
|
15 |
+
{%- set first_user_prefix = "" -%}
|
16 |
+
{%- set loop_messages = messages -%}
|
17 |
+
{%- endif -%}
|
18 |
+
{%- for message in loop_messages -%}
|
19 |
+
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
20 |
+
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
21 |
+
{%- endif -%}
|
22 |
+
{%- if (message['role'] == 'assistant') -%}
|
23 |
+
{%- set role = "model" -%}
|
24 |
+
{%- else -%}
|
25 |
+
{%- set role = message['role'] -%}
|
26 |
+
{%- endif -%}
|
27 |
+
{{ '<start_of_turn>' + role + '
|
28 |
+
' + (first_user_prefix if loop.first else "") }}
|
29 |
+
{%- if message['content'] is string -%}
|
30 |
+
{{ message['content'] | trim }}
|
31 |
+
{%- elif message['content'] is iterable -%}
|
32 |
+
{%- for item in message['content'] -%}
|
33 |
+
{%- if item['type'] == 'image' -%}
|
34 |
+
{{ '<start_of_image>' }}
|
35 |
+
{%- elif item['type'] == 'text' -%}
|
36 |
+
{{ item['text'] | trim }}
|
37 |
+
{%- endif -%}
|
38 |
+
{%- endfor -%}
|
39 |
+
{%- else -%}
|
40 |
+
{%- if message['content'] is defined -%}
|
41 |
+
{{ raise_exception("Invalid content type") }}
|
42 |
+
{%- endif -%}
|
43 |
+
{%- endif -%}
|
44 |
+
{{ '<end_of_turn>
|
45 |
+
' }}
|
46 |
+
{%- endfor -%}
|
47 |
+
{%- if add_generation_prompt -%}
|
48 |
+
{{'<start_of_turn>model
|
49 |
+
'}}
|
50 |
+
{%- endif -%}
|
51 |
+
|
52 |
+
{# Copyright 2025-present Unsloth. Apache 2.0 License. Unsloth Chat template fixes #}
|
config.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_sliding_window_pattern": 6,
|
3 |
+
"architectures": [
|
4 |
+
"Gemma3ForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"attn_logit_softcapping": null,
|
9 |
+
"bos_token_id": 2,
|
10 |
+
"eos_token_id": 106,
|
11 |
+
"final_logit_softcapping": null,
|
12 |
+
"head_dim": 256,
|
13 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
14 |
+
"hidden_size": 640,
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"intermediate_size": 2048,
|
17 |
+
"layer_types": [
|
18 |
+
"sliding_attention",
|
19 |
+
"sliding_attention",
|
20 |
+
"sliding_attention",
|
21 |
+
"sliding_attention",
|
22 |
+
"sliding_attention",
|
23 |
+
"full_attention",
|
24 |
+
"sliding_attention",
|
25 |
+
"sliding_attention",
|
26 |
+
"sliding_attention",
|
27 |
+
"sliding_attention",
|
28 |
+
"sliding_attention",
|
29 |
+
"full_attention",
|
30 |
+
"sliding_attention",
|
31 |
+
"sliding_attention",
|
32 |
+
"sliding_attention",
|
33 |
+
"sliding_attention",
|
34 |
+
"sliding_attention",
|
35 |
+
"full_attention"
|
36 |
+
],
|
37 |
+
"max_position_embeddings": 32768,
|
38 |
+
"model_type": "gemma3_text",
|
39 |
+
"num_attention_heads": 4,
|
40 |
+
"num_hidden_layers": 18,
|
41 |
+
"num_key_value_heads": 1,
|
42 |
+
"pad_token_id": 0,
|
43 |
+
"query_pre_attn_scalar": 256,
|
44 |
+
"rms_norm_eps": 1e-06,
|
45 |
+
"rope_local_base_freq": 10000.0,
|
46 |
+
"rope_scaling": null,
|
47 |
+
"rope_theta": 1000000.0,
|
48 |
+
"sliding_window": 512,
|
49 |
+
"torch_dtype": "bfloat16",
|
50 |
+
"transformers_version": "4.55.0",
|
51 |
+
"unsloth_fixed": true,
|
52 |
+
"use_bidirectional_attention": false,
|
53 |
+
"use_cache": true,
|
54 |
+
"vocab_size": 262144
|
55 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 2,
|
3 |
+
"cache_implementation": "hybrid",
|
4 |
+
"do_sample": true,
|
5 |
+
"eos_token_id": [
|
6 |
+
1,
|
7 |
+
106
|
8 |
+
],
|
9 |
+
"max_length": 32768,
|
10 |
+
"pad_token_id": 0,
|
11 |
+
"top_k": 64,
|
12 |
+
"top_p": 0.95,
|
13 |
+
"transformers_version": "4.55.0"
|
14 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:700b710a9a99c295ed546647aa81cacf9f81f4c573ea2be613a0e2517a44afab
|
3 |
+
size 536223056
|
special_tokens_map.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"boi_token": "<start_of_image>",
|
3 |
+
"bos_token": {
|
4 |
+
"content": "<bos>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false
|
9 |
+
},
|
10 |
+
"eoi_token": "<end_of_image>",
|
11 |
+
"eos_token": {
|
12 |
+
"content": "<end_of_turn>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false
|
17 |
+
},
|
18 |
+
"image_token": "<image_soft_token>",
|
19 |
+
"pad_token": {
|
20 |
+
"content": "<pad>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false
|
25 |
+
},
|
26 |
+
"unk_token": {
|
27 |
+
"content": "<unk>",
|
28 |
+
"lstrip": false,
|
29 |
+
"normalized": false,
|
30 |
+
"rstrip": false,
|
31 |
+
"single_word": false
|
32 |
+
}
|
33 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
|
3 |
+
size 33384568
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
|
3 |
+
size 4689074
|
tokenizer_config.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|