Upload 6 files
Browse files- chat_template.jinja +75 -0
- config.json +68 -0
- generation_config.json +13 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set ns = namespace(sys="", last_asst=-1) -%}
|
| 3 |
+
|
| 4 |
+
{%- if messages and messages[0]["role"] == "system" -%}
|
| 5 |
+
{%- set c = messages[0]["content"] -%}
|
| 6 |
+
{%- if c is string -%}
|
| 7 |
+
{%- set ns.sys = c -%}
|
| 8 |
+
{%- else -%}
|
| 9 |
+
{%- set parts = [] -%}
|
| 10 |
+
{%- for i in c if i["type"] == "text" -%}
|
| 11 |
+
{%- set _ = parts.append(i["text"]) -%}
|
| 12 |
+
{%- endfor -%}
|
| 13 |
+
{%- set ns.sys = parts | join("") -%}
|
| 14 |
+
{%- endif -%}
|
| 15 |
+
{%- set messages = messages[1:] -%}
|
| 16 |
+
{%- else -%}
|
| 17 |
+
{%- set ns.sys = "You're a helpful AI assistant." -%}
|
| 18 |
+
{%- endif -%}
|
| 19 |
+
|
| 20 |
+
{%- if tools -%}
|
| 21 |
+
{%- set tool_text = [] -%}
|
| 22 |
+
{%- for t in tools -%}
|
| 23 |
+
{%- set _ = tool_text.append(t if t is string else t|tojson) -%}
|
| 24 |
+
{%- endfor -%}
|
| 25 |
+
{%- set ns.sys = ns.sys + "
|
| 26 |
+
|
| 27 |
+
Tools:
|
| 28 |
+
" + (tool_text | join("
|
| 29 |
+
")) -%}
|
| 30 |
+
{%- endif -%}
|
| 31 |
+
|
| 32 |
+
{{- "system
|
| 33 |
+
" + ns.sys.strip() + eos_token -}}
|
| 34 |
+
|
| 35 |
+
{%- for m in messages if m["role"] == "assistant" -%}
|
| 36 |
+
{%- set ns.last_asst = loop.index0 -%}
|
| 37 |
+
{%- endfor -%}
|
| 38 |
+
|
| 39 |
+
{%- for m in messages -%}
|
| 40 |
+
{%- set c = m["content"] -%}
|
| 41 |
+
|
| 42 |
+
{%- if c is not string -%}
|
| 43 |
+
{%- set tmp = [] -%}
|
| 44 |
+
{%- for i in c -%}
|
| 45 |
+
{%- if i["type"] == "text" -%}
|
| 46 |
+
{%- set _ = tmp.append(i["text"]) -%}
|
| 47 |
+
{%- elif i["type"] == "image" -%}
|
| 48 |
+
{%- set _ = tmp.append("<image>") -%}
|
| 49 |
+
{%- endif -%}
|
| 50 |
+
{%- endfor -%}
|
| 51 |
+
{%- set c = tmp | join("") -%}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
|
| 54 |
+
{%- if m["role"] == "assistant" and loop.index0 != ns.last_asst and "</think>" in c -%}
|
| 55 |
+
{%- set parts = c.split("</think>") -%}
|
| 56 |
+
{%- set think_lines = parts[0].split("
|
| 57 |
+
") -%}
|
| 58 |
+
{%- set tail = (think_lines[-2:] | join("
|
| 59 |
+
")).strip() -%}
|
| 60 |
+
{%- set c = (tail + "
|
| 61 |
+
" if tail else "") + parts[-1].strip() -%}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
|
| 64 |
+
{%- set c = c.strip() -%}
|
| 65 |
+
|
| 66 |
+
{%- if c -%}
|
| 67 |
+
{{- m["role"] + "
|
| 68 |
+
" + c + eos_token -}}
|
| 69 |
+
{%- endif -%}
|
| 70 |
+
{%- endfor -%}
|
| 71 |
+
|
| 72 |
+
{%- if add_generation_prompt -%}
|
| 73 |
+
{{- "assistant
|
| 74 |
+
" -}}
|
| 75 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attention_k_eq_v": false,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"enable_moe_block": false,
|
| 11 |
+
"eos_token_id": 2,
|
| 12 |
+
"final_logit_softcapping": null,
|
| 13 |
+
"global_head_dim": 512,
|
| 14 |
+
"head_dim": 64,
|
| 15 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 16 |
+
"hidden_size": 896,
|
| 17 |
+
"hidden_size_per_layer_input": 8,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 3584,
|
| 20 |
+
"layer_types": [
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"sliding_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"full_attention"
|
| 35 |
+
],
|
| 36 |
+
"max_position_embeddings": 32768,
|
| 37 |
+
"model_type": "gemma4_text",
|
| 38 |
+
"moe_intermediate_size": null,
|
| 39 |
+
"norm_topk_prob": true,
|
| 40 |
+
"num_attention_heads": 14,
|
| 41 |
+
"num_experts": null,
|
| 42 |
+
"num_global_key_value_heads": null,
|
| 43 |
+
"num_hidden_layers": 14,
|
| 44 |
+
"num_key_value_heads": 2,
|
| 45 |
+
"num_kv_shared_layers": 0,
|
| 46 |
+
"pad_token_id": 0,
|
| 47 |
+
"rms_norm_eps": 1e-06,
|
| 48 |
+
"rope_parameters": {
|
| 49 |
+
"full_attention": {
|
| 50 |
+
"partial_rotary_factor": 0.25,
|
| 51 |
+
"rope_theta": 1000000.0,
|
| 52 |
+
"rope_type": "proportional"
|
| 53 |
+
},
|
| 54 |
+
"sliding_attention": {
|
| 55 |
+
"rope_theta": 10000.0,
|
| 56 |
+
"rope_type": "default"
|
| 57 |
+
}
|
| 58 |
+
},
|
| 59 |
+
"sliding_window": 128,
|
| 60 |
+
"tie_word_embeddings": true,
|
| 61 |
+
"top_k_experts": null,
|
| 62 |
+
"transformers_version": "5.8.0.dev0",
|
| 63 |
+
"use_bidirectional_attention": null,
|
| 64 |
+
"use_cache": false,
|
| 65 |
+
"use_double_wide_mlp": false,
|
| 66 |
+
"vocab_size": 24000,
|
| 67 |
+
"vocab_size_per_layer_input": 262144
|
| 68 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
2,
|
| 6 |
+
1
|
| 7 |
+
],
|
| 8 |
+
"output_attentions": false,
|
| 9 |
+
"output_hidden_states": false,
|
| 10 |
+
"pad_token_id": 0,
|
| 11 |
+
"transformers_version": "5.8.0.dev0",
|
| 12 |
+
"use_cache": true
|
| 13 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8552ab67404ed820154e25550f8bd54209421811160ed3da5ca8c59bd344cb8
|
| 3 |
+
size 1001353760
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|sos|>",
|
| 4 |
+
"eos_token": "<|eos|>",
|
| 5 |
+
"is_local": true,
|
| 6 |
+
"local_files_only": false,
|
| 7 |
+
"max_length": 32768,
|
| 8 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 9 |
+
"pad_token": "<|pad|>",
|
| 10 |
+
"padding_side": "right",
|
| 11 |
+
"stride": 0,
|
| 12 |
+
"tokenizer_class": "TokenizersBackend",
|
| 13 |
+
"truncation_side": "right",
|
| 14 |
+
"truncation_strategy": "longest_first",
|
| 15 |
+
"unk_token": "<|unk|>"
|
| 16 |
+
}
|