bethrezen commited on
Commit
1917d38
·
verified ·
1 Parent(s): f6eb39a

Upload folder using huggingface_hub

Browse files
.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
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
chat_template.jinja ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Begin-of-sequence token to start the model prompt -#}
2
+ {{ bos_token }}
3
+ {#- Extracts the system message. Gemma does not support system messages so it will be prepended to first user message. -#}
4
+ {%- if messages[0]['role'] == 'system' -%}
5
+ {%- if messages[0]['content'] is string -%}
6
+ {%- set system_message = messages[0]['content'] -%}
7
+ {%- else -%}
8
+ {%- set system_message = messages[0]['content'][0]['text'] -%}
9
+ {%- endif -%}
10
+ {%- set loop_messages = messages[1:] -%}
11
+ {%- else -%}
12
+ {%- set system_message = "You are a helpful assistant Zero-Gemma made by ZeroAgency company from Russia. You must be helpful, harmless, and honest." -%}
13
+ {%- set loop_messages = messages -%}
14
+ {%- endif -%}
15
+
16
+ {%- if enable_thinking is defined and enable_thinking is true -%}
17
+ {%- set system_message = system_message + "\nFirst, think through the reasoning internally, then present the reasoning within <think>...</think>. After thinking, clearly state a response that addresses the user's request and aligns with their preferences, not just providing a direct answer." -%}
18
+ {%- endif -%}
19
+
20
+ {%- set system_message = system_message + '\n\n' -%}
21
+ {#- Set tools to none if not defined for this ChatCompletion request (helps avoid errors later) -#}
22
+ {%- if not tools is defined -%}
23
+ {%- set tools = none -%}
24
+ {%- endif -%}
25
+
26
+ {#- First - system message -#}
27
+
28
+ {{ '<start_of_turn>system\n' -}}
29
+ {{ system_message }}
30
+ {#- Append system message with tool information if using tools in message request. -#}
31
+ {%- if tools is not none -%}
32
+ {{- "Tools (functions) are available. If you decide to invoke one or more of the tools, you must respond with a python list of the function calls.\n" -}}
33
+ {{- "Example Format: [func_name1(params_name1=params_value1, params_name2=params_value2...), func_name2(params)] \n" -}}
34
+ {{- "Do not use variables. DO NOT USE MARKDOWN SYNTAX. You SHOULD NOT include any other text in the response if you call a function. If none of the functions can be used, point it out. If you lack the parameters required by the function, also point it out.\n" -}}
35
+ {{- "Here is a list of functions in JSON format that you can invoke.\n" -}}
36
+ {{- tools | tojson(indent=4) -}}
37
+ {{- "\n\n" -}}
38
+ {%- endif -%}
39
+ {{ '<end_of_turn>\n' }}
40
+
41
+ {#- Main loop over all messages in the conversation history -#}
42
+ {%- for message in loop_messages if message['role'] != 'system' -%}
43
+ {#- Normalize roles for model prompt formatting -#}
44
+ {%- if (message['role'] == 'assistant') -%}
45
+ {%- set role = "model" -%}
46
+ {%- elif (message['role'] == 'tool') -%}
47
+ {%- set role = "user" -%}
48
+ {%- else -%}
49
+ {%- set role = message['role'] -%}
50
+ {%- endif -%}
51
+ {#- Mark the start of a message block with the appropriate role -#}
52
+ {{ '<start_of_turn>' + role + '\n' -}}
53
+
54
+ {#- Format model tool calls (turns where model indicates they want to call a tool) -#}
55
+ {%- if 'tool_calls' in message -%}
56
+ {%- if message['content'] is string -%}
57
+ {%- set content = message['content'] -%}
58
+ {%- if '</think>' in content -%}
59
+ {{- content | trim -}}
60
+ {{- "\n" -}}
61
+ {%- endif -%}
62
+ {%- endif -%}
63
+ {#- Opening bracket for tool call list. -#}
64
+ {{- '[' -}}
65
+ {#- For each tool call -#}
66
+ {%- for tool_call in message.tool_calls -%}
67
+ {#- Function name & opening parenthesis. -#}
68
+ {%- if tool_call.function is defined -%}
69
+ {%- set tool_call = tool_call.function -%}
70
+ {%- endif -%}
71
+ {{- tool_call.name + '(' -}}
72
+
73
+ {#-- Handle arguments as list (positional) or dict (named) --#}
74
+ {#-- Named arguments (dict) --#}
75
+ {%- if tool_call.arguments is iterable and tool_call.arguments is mapping -%}
76
+ {%- set first = true -%}
77
+ {%- for key, val in tool_call.arguments.items() -%}
78
+ {%- if not first %}, {% endif -%}
79
+ {{ key }}={{ val | tojson }}
80
+ {%- set first = false -%}
81
+ {%- endfor -%}
82
+ {#-- Positional arguments (list) --#}
83
+ {%- elif tool_call.arguments is iterable -%}
84
+ {{- tool_call.arguments | map('tojson') | join(', ') -}}
85
+ {#-- Fallback: single positional value --#}
86
+ {%- else -%}
87
+ {{- tool_call.arguments | tojson -}}
88
+ {#-- Closing parenthesis. --#}
89
+ {%- endif -%}
90
+ {{- ')' -}}
91
+ {#-- If more than one tool call, place comma and move to formatting next tool call --#}
92
+ {%- if not loop.last -%}{{- "," -}}{%- endif -%}
93
+ {%- endfor -%}
94
+ {#- Closing bracket for tool call list. -#}
95
+ {{- ']' -}}
96
+ {%- endif -%}
97
+
98
+ {#- Tool response start tag (for messages from a tool) -#}
99
+ {%- if (message['role'] == 'tool') -%}
100
+ {{- '<tool_response>\n' -}}
101
+ {%- endif -%}
102
+
103
+ {#- Render the message content: handle plain string or multimodal content like image/text -#}
104
+ {%- if not 'tool_calls' in message and message['content'] -%}
105
+ {%- if message['content'] is string -%}
106
+ {%- set content = message['content'] -%}
107
+ {# {%- if '</think>' in content -%}
108
+ {%- set content = content.split('</think>')[-1] -%}
109
+ {%- endif -%} #}
110
+ {{- content | trim -}}
111
+ {%- elif message['content'] is iterable -%}
112
+ {%- for item in message['content'] -%}
113
+ {%- if item['type'] == 'image' -%}
114
+ {{ '<start_of_image>' }}
115
+ {%- elif item['type'] == 'text' -%}
116
+ {%- set content = item['text'] -%}
117
+ {%- if '</think>' in content -%}
118
+ {%- set content = content.split('</think>')[-1] -%}
119
+ {%- endif -%}
120
+ {{ content | trim }}
121
+ {%- endif -%}
122
+ {%- endfor -%}
123
+ {%- else -%}
124
+ {{ raise_exception("Invalid content type:"+ message|tojson) }}
125
+ {%- endif -%}
126
+ {%- endif -%}
127
+
128
+ {#- Tool response end tag -#}
129
+ {%- if (message['role'] == 'tool') -%}
130
+ {{ '</tool_response>' -}}
131
+ {%- endif -%}
132
+
133
+ {#- Mark end of a single turn -#}
134
+ {{ '<end_of_turn>\n' }}
135
+ {%- endfor -%}
136
+
137
+ {#- If generation is to be triggered, add model prompt prefix -#}
138
+ {%- if add_generation_prompt -%}
139
+ {{'<start_of_turn>model\n'}}
140
+ {%- if enable_thinking is defined and enable_thinking is true -%}
141
+ {{- '<think>' -}}
142
+ {%- endif %}
143
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma3ForConditionalGeneration"
4
+ ],
5
+ "boi_token_index": 255999,
6
+ "eoi_token_index": 256000,
7
+ "eos_token_id": [
8
+ 1,
9
+ 106
10
+ ],
11
+ "image_token_index": 262144,
12
+ "initializer_range": 0.02,
13
+ "mm_tokens_per_image": 256,
14
+ "model_type": "gemma3",
15
+ "text_config": {
16
+ "attention_bias": false,
17
+ "attention_dropout": 0.0,
18
+ "attn_logit_softcapping": null,
19
+ "cache_implementation": "hybrid",
20
+ "final_logit_softcapping": null,
21
+ "head_dim": 256,
22
+ "hidden_activation": "gelu_pytorch_tanh",
23
+ "hidden_size": 3840,
24
+ "initializer_range": 0.02,
25
+ "intermediate_size": 15360,
26
+ "max_position_embeddings": 131072,
27
+ "model_type": "gemma3_text",
28
+ "num_attention_heads": 16,
29
+ "num_hidden_layers": 48,
30
+ "num_key_value_heads": 8,
31
+ "query_pre_attn_scalar": 256,
32
+ "rms_norm_eps": 1e-06,
33
+ "rope_local_base_freq": 10000.0,
34
+ "rope_scaling": {
35
+ "factor": 8.0,
36
+ "rope_type": "linear"
37
+ },
38
+ "rope_theta": 1000000.0,
39
+ "sliding_window": 1024,
40
+ "sliding_window_pattern": 6,
41
+ "use_cache": true,
42
+ "vocab_size": 262208
43
+ },
44
+ "torch_dtype": "bfloat16",
45
+ "transformers_version": "4.51.3",
46
+ "vision_config": {
47
+ "attention_dropout": 0.0,
48
+ "hidden_act": "gelu_pytorch_tanh",
49
+ "hidden_size": 1152,
50
+ "image_size": 896,
51
+ "intermediate_size": 4304,
52
+ "layer_norm_eps": 1e-06,
53
+ "model_type": "siglip_vision_model",
54
+ "num_attention_heads": 16,
55
+ "num_channels": 3,
56
+ "num_hidden_layers": 27,
57
+ "patch_size": 14,
58
+ "vision_use_head": false
59
+ }
60
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 1,
7
+ 106
8
+ ],
9
+ "pad_token_id": 0,
10
+ "top_k": 64,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.51.3"
13
+ }
model-00001-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4847447e92599833e8dbaa3067cd201c3bb5c052efa91f11ba891e43234f7832
3
+ size 4979902192
model-00002-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:891bd54eed03cba9ee1e705533a02a8217fcc29f356e4a1f53e5fd0d178883ad
3
+ size 4931296592
model-00003-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cee411d9d57324e50ce064a192cc5a858276d508611b12fc599e0c9767112e0
3
+ size 4931296656
model-00004-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bc75a29a730c9e743cad013feda3b0991a913fafe787c58a1c6e20afad97723
3
+ size 4931296656
model-00005-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed14bd4908c98fed9f61e8cd410167e0846de9abd78e0452ab092072e5d9252d
3
+ size 4601000928
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
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": "<eos>",
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