Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +25 -0
- chat_template.jinja +263 -0
- config.json +191 -0
- generation_config.json +14 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +0 -0
- processor_config.json +32 -0
- tokenizer.json +3 -0
- tokenizer_config.json +95 -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,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: mlx
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
license_link: https://ai.google.dev/gemma/docs/gemma_4_license
|
| 5 |
+
pipeline_tag: any-to-any
|
| 6 |
+
base_model: google/gemma-4-e2b-it
|
| 7 |
+
tags:
|
| 8 |
+
- mlx
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# mlx-community/gemma-4-e2b-it-bf16
|
| 12 |
+
|
| 13 |
+
This model was converted to MLX format from [`google/gemma-4-e2b-it`](https://huggingface.co/google/gemma-4-e2b-it)
|
| 14 |
+
using mlx-vlm version **0.4.3**.
|
| 15 |
+
Refer to the [original model card](https://huggingface.co/google/gemma-4-e2b-it) for more details on the model.
|
| 16 |
+
|
| 17 |
+
## Use with mlx
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
pip install -U mlx-vlm
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
python -m mlx_vlm.generate --model mlx-community/gemma-4-e2b-it-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
|
| 25 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro format_parameters(properties, required) -%}
|
| 2 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 3 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 4 |
+
{%- for key, value in properties | dictsort -%}
|
| 5 |
+
{%- set add_comma = false -%}
|
| 6 |
+
{%- if key not in standard_keys -%}
|
| 7 |
+
{%- if ns.found_first %},{% endif -%}
|
| 8 |
+
{%- set ns.found_first = true -%}
|
| 9 |
+
{{ key }}:{
|
| 10 |
+
{%- if value['description'] -%}
|
| 11 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 12 |
+
{%- set add_comma = true -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- if value['nullable'] %}
|
| 15 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 16 |
+
nullable:true
|
| 17 |
+
{%- endif -%}
|
| 18 |
+
{%- if value['type'] | upper == 'STRING' -%}
|
| 19 |
+
{%- if value['enum'] -%}
|
| 20 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 21 |
+
enum:{{ format_argument(value['enum']) }}
|
| 22 |
+
{%- endif -%}
|
| 23 |
+
{%- elif value['type'] | upper == 'OBJECT' -%}
|
| 24 |
+
,properties:{
|
| 25 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 26 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 27 |
+
{%- elif value is mapping -%}
|
| 28 |
+
{{- format_parameters(value, value['required'] | default([])) -}}
|
| 29 |
+
{%- endif -%}
|
| 30 |
+
}
|
| 31 |
+
{%- if value['required'] -%}
|
| 32 |
+
,required:[
|
| 33 |
+
{%- for item in value['required'] | default([]) -%}
|
| 34 |
+
<|"|>{{- item -}}<|"|>
|
| 35 |
+
{%- if not loop.last %},{% endif -%}
|
| 36 |
+
{%- endfor -%}
|
| 37 |
+
]
|
| 38 |
+
{%- endif -%}
|
| 39 |
+
{%- elif value['type'] | upper == 'ARRAY' -%}
|
| 40 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 41 |
+
,items:{
|
| 42 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 43 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 44 |
+
{%- if item_value is not none -%}
|
| 45 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 46 |
+
{%- set ns_items.found_first = true -%}
|
| 47 |
+
{%- if item_key == 'properties' -%}
|
| 48 |
+
properties:{
|
| 49 |
+
{%- if item_value is mapping -%}
|
| 50 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 51 |
+
{%- endif -%}
|
| 52 |
+
}
|
| 53 |
+
{%- elif item_key == 'required' -%}
|
| 54 |
+
required:[
|
| 55 |
+
{%- for req_item in item_value -%}
|
| 56 |
+
<|"|>{{- req_item -}}<|"|>
|
| 57 |
+
{%- if not loop.last %},{% endif -%}
|
| 58 |
+
{%- endfor -%}
|
| 59 |
+
]
|
| 60 |
+
{%- elif item_key == 'type' -%}
|
| 61 |
+
{%- if item_value is string -%}
|
| 62 |
+
type:{{ format_argument(item_value | upper) }}
|
| 63 |
+
{%- else -%}
|
| 64 |
+
type:{{ format_argument(item_value | map('upper') | list) }}
|
| 65 |
+
{%- endif -%}
|
| 66 |
+
{%- else -%}
|
| 67 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 68 |
+
{%- endif -%}
|
| 69 |
+
{%- endif -%}
|
| 70 |
+
{%- endfor -%}
|
| 71 |
+
}
|
| 72 |
+
{%- endif -%}
|
| 73 |
+
{%- endif -%}
|
| 74 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 75 |
+
type:<|"|>{{ value['type'] | upper }}<|"|>}
|
| 76 |
+
{%- endif -%}
|
| 77 |
+
{%- endfor -%}
|
| 78 |
+
{%- endmacro -%}
|
| 79 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 80 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 81 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 82 |
+
{%- if params -%}
|
| 83 |
+
,parameters:{
|
| 84 |
+
{%- if params['properties'] -%}
|
| 85 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 86 |
+
{%- endif -%}
|
| 87 |
+
{%- if params['required'] -%}
|
| 88 |
+
required:[
|
| 89 |
+
{%- for item in params['required'] -%}
|
| 90 |
+
<|"|>{{- item -}}<|"|>
|
| 91 |
+
{{- ',' if not loop.last -}}
|
| 92 |
+
{%- endfor -%}
|
| 93 |
+
],
|
| 94 |
+
{%- endif -%}
|
| 95 |
+
{%- if params['type'] -%}
|
| 96 |
+
type:<|"|>{{- params['type'] | upper -}}<|"|>}
|
| 97 |
+
{%- endif -%}
|
| 98 |
+
{%- endif -%}
|
| 99 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 100 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 101 |
+
,response:{
|
| 102 |
+
{%- if response_declaration['description'] -%}
|
| 103 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- if response_declaration['type'] | upper == 'OBJECT' -%}
|
| 106 |
+
type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
|
| 107 |
+
{%- endif -%}
|
| 108 |
+
{%- endif -%}
|
| 109 |
+
}
|
| 110 |
+
{%- endmacro -%}
|
| 111 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 112 |
+
{%- if argument is string -%}
|
| 113 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 114 |
+
{%- elif argument is boolean -%}
|
| 115 |
+
{{- 'true' if argument else 'false' -}}
|
| 116 |
+
{%- elif argument is mapping -%}
|
| 117 |
+
{{- '{' -}}
|
| 118 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 119 |
+
{%- for key, value in argument | dictsort -%}
|
| 120 |
+
{%- if ns.found_first %},{% endif -%}
|
| 121 |
+
{%- set ns.found_first = true -%}
|
| 122 |
+
{%- if escape_keys -%}
|
| 123 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 124 |
+
{%- else -%}
|
| 125 |
+
{{- key -}}
|
| 126 |
+
{%- endif -%}
|
| 127 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 128 |
+
{%- endfor -%}
|
| 129 |
+
{{- '}' -}}
|
| 130 |
+
{%- elif argument is sequence -%}
|
| 131 |
+
{{- '[' -}}
|
| 132 |
+
{%- for item in argument -%}
|
| 133 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 134 |
+
{%- if not loop.last %},{% endif -%}
|
| 135 |
+
{%- endfor -%}
|
| 136 |
+
{{- ']' -}}
|
| 137 |
+
{%- else -%}
|
| 138 |
+
{{- argument -}}
|
| 139 |
+
{%- endif -%}
|
| 140 |
+
{%- endmacro -%}
|
| 141 |
+
{%- macro strip_thinking(text) -%}
|
| 142 |
+
{%- set ns = namespace(result='') -%}
|
| 143 |
+
{%- for part in text.split('<channel|>') -%}
|
| 144 |
+
{%- if '<|channel>' in part -%}
|
| 145 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 146 |
+
{%- else -%}
|
| 147 |
+
{%- set ns.result = ns.result + part -%}
|
| 148 |
+
{%- endif -%}
|
| 149 |
+
{%- endfor -%}
|
| 150 |
+
{{- ns.result | trim -}}
|
| 151 |
+
{%- endmacro -%}
|
| 152 |
+
|
| 153 |
+
{%- set ns = namespace(prev_message_type=None) -%}
|
| 154 |
+
{%- set loop_messages = messages -%}
|
| 155 |
+
{{ bos_token }}
|
| 156 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 157 |
+
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 158 |
+
{{- '<|turn>system\n' -}}
|
| 159 |
+
|
| 160 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 161 |
+
{%- if enable_thinking is defined and enable_thinking -%}
|
| 162 |
+
{{- '<|think|>' -}}
|
| 163 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 164 |
+
{%- endif -%}
|
| 165 |
+
|
| 166 |
+
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 167 |
+
{{- messages[0]['content'] | trim -}}
|
| 168 |
+
{%- set loop_messages = messages[1:] -%}
|
| 169 |
+
{%- endif -%}
|
| 170 |
+
|
| 171 |
+
{%- if tools -%}
|
| 172 |
+
{%- for tool in tools %}
|
| 173 |
+
{{- '<|tool>' -}}
|
| 174 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 175 |
+
{{- '<tool|>' -}}
|
| 176 |
+
{%- endfor %}
|
| 177 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 178 |
+
{%- endif -%}
|
| 179 |
+
|
| 180 |
+
{{- '<turn|>\n' -}}
|
| 181 |
+
{%- endif %}
|
| 182 |
+
|
| 183 |
+
{#- Loop through messages -#}
|
| 184 |
+
{%- for message in loop_messages -%}
|
| 185 |
+
{%- set ns.prev_message_type = None -%}
|
| 186 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 187 |
+
{{- '<|turn>' + role + '\n' }}
|
| 188 |
+
|
| 189 |
+
{%- if message['tool_calls'] -%}
|
| 190 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 191 |
+
{%- set function = tool_call['function'] -%}
|
| 192 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 193 |
+
{%- if function['arguments'] is mapping -%}
|
| 194 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 195 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 196 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 197 |
+
{%- set ns_args.found_first = true -%}
|
| 198 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 199 |
+
{%- endfor -%}
|
| 200 |
+
{%- elif function['arguments'] is string -%}
|
| 201 |
+
{{- function['arguments'] -}}
|
| 202 |
+
{%- endif -%}
|
| 203 |
+
{{- '}<tool_call|>' -}}
|
| 204 |
+
{%- endfor -%}
|
| 205 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 206 |
+
{%- endif -%}
|
| 207 |
+
|
| 208 |
+
{%- if message['tool_responses'] -%}
|
| 209 |
+
{#- Tool Response handling -#}
|
| 210 |
+
{%- for tool_response in message['tool_responses'] -%}
|
| 211 |
+
{{- '<|tool_response>' -}}
|
| 212 |
+
{%- if tool_response['response'] is mapping -%}
|
| 213 |
+
{{- 'response:' + tool_response['name'] | default('unknown') + '{' -}}
|
| 214 |
+
{%- for key, value in tool_response['response'] | dictsort -%}
|
| 215 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 216 |
+
{%- if not loop.last %},{% endif -%}
|
| 217 |
+
{%- endfor -%}
|
| 218 |
+
{{- '}' -}}
|
| 219 |
+
{%- else -%}
|
| 220 |
+
{{- 'response:' + tool_response['name'] | default('unknown') + '{value:' + format_argument(tool_response['response'], escape_keys=False) + '}' -}}
|
| 221 |
+
{%- endif -%}
|
| 222 |
+
{{- '<tool_response|>' -}}
|
| 223 |
+
{%- endfor -%}
|
| 224 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 225 |
+
{%- endif -%}
|
| 226 |
+
|
| 227 |
+
{%- if message['content'] is string -%}
|
| 228 |
+
{%- if role == 'model' -%}
|
| 229 |
+
{{- strip_thinking(message['content']) -}}
|
| 230 |
+
{%- else -%}
|
| 231 |
+
{{- message['content'] | trim -}}
|
| 232 |
+
{%- endif -%}
|
| 233 |
+
{%- elif message['content'] is sequence -%}
|
| 234 |
+
{%- for item in message['content'] -%}
|
| 235 |
+
{%- if item['type'] == 'text' -%}
|
| 236 |
+
{%- if role == 'model' -%}
|
| 237 |
+
{{- strip_thinking(item['text']) -}}
|
| 238 |
+
{%- else -%}
|
| 239 |
+
{{- item['text'] | trim -}}
|
| 240 |
+
{%- endif -%}
|
| 241 |
+
{%- elif item['type'] == 'image' -%}
|
| 242 |
+
{{- '\n\n<|image|>\n\n' -}}
|
| 243 |
+
{%- set ns.prev_message_type = 'image' -%}
|
| 244 |
+
{%- elif item['type'] == 'audio' -%}
|
| 245 |
+
{{- '<|audio|>' -}}
|
| 246 |
+
{%- set ns.prev_message_type = 'audio' -%}
|
| 247 |
+
{%- elif item['type'] == 'video' -%}
|
| 248 |
+
{{- '\n\n<|video|>\n\n' -}}
|
| 249 |
+
{%- set ns.prev_message_type = 'video' -%}
|
| 250 |
+
{%- endif -%}
|
| 251 |
+
{%- endfor -%}
|
| 252 |
+
{%- endif -%}
|
| 253 |
+
|
| 254 |
+
{%- if not (message['tool_responses'] and not message['content']) -%}
|
| 255 |
+
{{- '<turn|>\n' -}}
|
| 256 |
+
{%- endif -%}
|
| 257 |
+
{%- endfor -%}
|
| 258 |
+
|
| 259 |
+
{%- if add_generation_prompt -%}
|
| 260 |
+
{%- if ns.prev_message_type != 'tool_response' -%}
|
| 261 |
+
{{- '<|turn>model\n' -}}
|
| 262 |
+
{%- endif -%}
|
| 263 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"audio_config": {
|
| 6 |
+
"_name_or_path": "",
|
| 7 |
+
"architectures": null,
|
| 8 |
+
"attention_chunk_size": 12,
|
| 9 |
+
"attention_context_left": 13,
|
| 10 |
+
"attention_context_right": 0,
|
| 11 |
+
"attention_invalid_logits_value": -1000000000.0,
|
| 12 |
+
"attention_logit_cap": 50.0,
|
| 13 |
+
"chunk_size_feed_forward": 0,
|
| 14 |
+
"conv_kernel_size": 5,
|
| 15 |
+
"dtype": "bfloat16",
|
| 16 |
+
"gradient_clipping": 10000000000.0,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 1024,
|
| 19 |
+
"id2label": {
|
| 20 |
+
"0": "LABEL_0",
|
| 21 |
+
"1": "LABEL_1"
|
| 22 |
+
},
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"is_encoder_decoder": false,
|
| 25 |
+
"label2id": {
|
| 26 |
+
"LABEL_0": 0,
|
| 27 |
+
"LABEL_1": 1
|
| 28 |
+
},
|
| 29 |
+
"model_type": "gemma4_audio",
|
| 30 |
+
"num_attention_heads": 8,
|
| 31 |
+
"num_hidden_layers": 12,
|
| 32 |
+
"output_attentions": false,
|
| 33 |
+
"output_hidden_states": false,
|
| 34 |
+
"output_proj_dims": 1536,
|
| 35 |
+
"problem_type": null,
|
| 36 |
+
"residual_weight": 0.5,
|
| 37 |
+
"return_dict": true,
|
| 38 |
+
"rms_norm_eps": 1e-06,
|
| 39 |
+
"subsampling_conv_channels": [
|
| 40 |
+
128,
|
| 41 |
+
32
|
| 42 |
+
],
|
| 43 |
+
"use_clipped_linears": true
|
| 44 |
+
},
|
| 45 |
+
"audio_token_id": 258881,
|
| 46 |
+
"boa_token_id": 256000,
|
| 47 |
+
"boi_token_id": 255999,
|
| 48 |
+
"dtype": "bfloat16",
|
| 49 |
+
"eoa_token_id": 258883,
|
| 50 |
+
"eoa_token_index": 258883,
|
| 51 |
+
"eoi_token_id": 258882,
|
| 52 |
+
"eos_token_id": [
|
| 53 |
+
1,
|
| 54 |
+
106,
|
| 55 |
+
50
|
| 56 |
+
],
|
| 57 |
+
"image_token_id": 258880,
|
| 58 |
+
"initializer_range": 0.02,
|
| 59 |
+
"model_type": "gemma4",
|
| 60 |
+
"text_config": {
|
| 61 |
+
"attention_bias": false,
|
| 62 |
+
"attention_dropout": 0.0,
|
| 63 |
+
"attention_k_eq_v": false,
|
| 64 |
+
"bos_token_id": 2,
|
| 65 |
+
"dtype": "bfloat16",
|
| 66 |
+
"enable_moe_block": false,
|
| 67 |
+
"eos_token_id": 1,
|
| 68 |
+
"expert_intermediate_size": null,
|
| 69 |
+
"final_logit_softcapping": 30.0,
|
| 70 |
+
"global_head_dim": 512,
|
| 71 |
+
"head_dim": 256,
|
| 72 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 73 |
+
"hidden_size": 1536,
|
| 74 |
+
"hidden_size_per_layer_input": 256,
|
| 75 |
+
"initializer_range": 0.02,
|
| 76 |
+
"intermediate_size": 6144,
|
| 77 |
+
"layer_types": [
|
| 78 |
+
"sliding_attention",
|
| 79 |
+
"sliding_attention",
|
| 80 |
+
"sliding_attention",
|
| 81 |
+
"sliding_attention",
|
| 82 |
+
"full_attention",
|
| 83 |
+
"sliding_attention",
|
| 84 |
+
"sliding_attention",
|
| 85 |
+
"sliding_attention",
|
| 86 |
+
"sliding_attention",
|
| 87 |
+
"full_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"sliding_attention",
|
| 90 |
+
"sliding_attention",
|
| 91 |
+
"sliding_attention",
|
| 92 |
+
"full_attention",
|
| 93 |
+
"sliding_attention",
|
| 94 |
+
"sliding_attention",
|
| 95 |
+
"sliding_attention",
|
| 96 |
+
"sliding_attention",
|
| 97 |
+
"full_attention",
|
| 98 |
+
"sliding_attention",
|
| 99 |
+
"sliding_attention",
|
| 100 |
+
"sliding_attention",
|
| 101 |
+
"sliding_attention",
|
| 102 |
+
"full_attention",
|
| 103 |
+
"sliding_attention",
|
| 104 |
+
"sliding_attention",
|
| 105 |
+
"sliding_attention",
|
| 106 |
+
"sliding_attention",
|
| 107 |
+
"full_attention",
|
| 108 |
+
"sliding_attention",
|
| 109 |
+
"sliding_attention",
|
| 110 |
+
"sliding_attention",
|
| 111 |
+
"sliding_attention",
|
| 112 |
+
"full_attention"
|
| 113 |
+
],
|
| 114 |
+
"max_position_embeddings": 131072,
|
| 115 |
+
"model_type": "gemma4_text",
|
| 116 |
+
"num_attention_heads": 8,
|
| 117 |
+
"num_experts": null,
|
| 118 |
+
"num_global_key_value_heads": null,
|
| 119 |
+
"num_hidden_layers": 35,
|
| 120 |
+
"num_key_value_heads": 1,
|
| 121 |
+
"num_kv_shared_layers": 20,
|
| 122 |
+
"pad_token_id": 0,
|
| 123 |
+
"rms_norm_eps": 1e-06,
|
| 124 |
+
"rope_parameters": {
|
| 125 |
+
"full_attention": {
|
| 126 |
+
"partial_rotary_factor": 0.25,
|
| 127 |
+
"rope_theta": 1000000.0,
|
| 128 |
+
"rope_type": "proportional"
|
| 129 |
+
},
|
| 130 |
+
"sliding_attention": {
|
| 131 |
+
"rope_theta": 10000.0,
|
| 132 |
+
"rope_type": "default"
|
| 133 |
+
}
|
| 134 |
+
},
|
| 135 |
+
"sliding_window": 512,
|
| 136 |
+
"tie_word_embeddings": true,
|
| 137 |
+
"top_k_experts": null,
|
| 138 |
+
"use_bidirectional_attention": null,
|
| 139 |
+
"use_cache": true,
|
| 140 |
+
"use_double_wide_mlp": true,
|
| 141 |
+
"vocab_size": 262144,
|
| 142 |
+
"vocab_size_per_layer_input": 262144
|
| 143 |
+
},
|
| 144 |
+
"tie_word_embeddings": true,
|
| 145 |
+
"transformers_version": "5.5.0.dev0",
|
| 146 |
+
"video_token_id": 258884,
|
| 147 |
+
"vision_config": {
|
| 148 |
+
"_name_or_path": "",
|
| 149 |
+
"architectures": null,
|
| 150 |
+
"attention_bias": false,
|
| 151 |
+
"attention_dropout": 0.0,
|
| 152 |
+
"chunk_size_feed_forward": 0,
|
| 153 |
+
"default_output_length": 280,
|
| 154 |
+
"dtype": "bfloat16",
|
| 155 |
+
"global_head_dim": 64,
|
| 156 |
+
"head_dim": 64,
|
| 157 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 158 |
+
"hidden_size": 768,
|
| 159 |
+
"id2label": {
|
| 160 |
+
"0": "LABEL_0",
|
| 161 |
+
"1": "LABEL_1"
|
| 162 |
+
},
|
| 163 |
+
"initializer_range": 0.02,
|
| 164 |
+
"intermediate_size": 3072,
|
| 165 |
+
"is_encoder_decoder": false,
|
| 166 |
+
"label2id": {
|
| 167 |
+
"LABEL_0": 0,
|
| 168 |
+
"LABEL_1": 1
|
| 169 |
+
},
|
| 170 |
+
"max_position_embeddings": 131072,
|
| 171 |
+
"model_type": "gemma4_vision",
|
| 172 |
+
"num_attention_heads": 12,
|
| 173 |
+
"num_hidden_layers": 16,
|
| 174 |
+
"num_key_value_heads": 12,
|
| 175 |
+
"output_attentions": false,
|
| 176 |
+
"output_hidden_states": false,
|
| 177 |
+
"patch_size": 16,
|
| 178 |
+
"pooling_kernel_size": 3,
|
| 179 |
+
"position_embedding_size": 10240,
|
| 180 |
+
"problem_type": null,
|
| 181 |
+
"return_dict": true,
|
| 182 |
+
"rms_norm_eps": 1e-06,
|
| 183 |
+
"rope_parameters": {
|
| 184 |
+
"rope_theta": 100.0,
|
| 185 |
+
"rope_type": "default"
|
| 186 |
+
},
|
| 187 |
+
"standardize": false,
|
| 188 |
+
"use_clipped_linears": true
|
| 189 |
+
},
|
| 190 |
+
"vision_soft_tokens_per_image": 280
|
| 191 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 2,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
1,
|
| 6 |
+
106,
|
| 7 |
+
50
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 0,
|
| 10 |
+
"temperature": 1.0,
|
| 11 |
+
"top_k": 64,
|
| 12 |
+
"top_p": 0.95,
|
| 13 |
+
"transformers_version": "5.5.0.dev0"
|
| 14 |
+
}
|
model-00001-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff4c28c7f1b0a841697cdd10fc7b45d434c2edeb6e02360e8a56ed88fa7b1cef
|
| 3 |
+
size 4569831590
|
model-00002-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2d44b0ee3454db90d6d10b4006b0270be0729094809570c9b366f3a35ca7655
|
| 3 |
+
size 5366705230
|
model-00003-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2fb5cbee871ebe7dcfaebef771c3013dd6cee51d9c8e0023d5d7c32cb0e9e244
|
| 3 |
+
size 310074804
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_seq_length": 750,
|
| 3 |
+
"image_processor": {
|
| 4 |
+
"do_convert_rgb": true,
|
| 5 |
+
"do_normalize": false,
|
| 6 |
+
"do_rescale": true,
|
| 7 |
+
"do_resize": true,
|
| 8 |
+
"image_mean": [
|
| 9 |
+
0.0,
|
| 10 |
+
0.0,
|
| 11 |
+
0.0
|
| 12 |
+
],
|
| 13 |
+
"image_processor_type": "Gemma4ImageProcessor",
|
| 14 |
+
"image_seq_length": 280,
|
| 15 |
+
"image_std": [
|
| 16 |
+
1.0,
|
| 17 |
+
1.0,
|
| 18 |
+
1.0
|
| 19 |
+
],
|
| 20 |
+
"max_soft_tokens": 280,
|
| 21 |
+
"patch_size": 16,
|
| 22 |
+
"pooling_kernel_size": 3,
|
| 23 |
+
"resample": 3,
|
| 24 |
+
"rescale_factor": 0.00392156862745098,
|
| 25 |
+
"size": {
|
| 26 |
+
"height": 224,
|
| 27 |
+
"width": 224
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"image_seq_length": 280,
|
| 31 |
+
"processor_class": "Gemma4Processor"
|
| 32 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
|
| 3 |
+
size 32169626
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"boa_token": "<|audio>",
|
| 5 |
+
"boi_token": "<|image>",
|
| 6 |
+
"bos_token": "<bos>",
|
| 7 |
+
"eoa_token": "<audio|>",
|
| 8 |
+
"eoc_token": "<channel|>",
|
| 9 |
+
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<eos>",
|
| 11 |
+
"eot_token": "<turn|>",
|
| 12 |
+
"escape_token": "<|\"|>",
|
| 13 |
+
"etc_token": "<tool_call|>",
|
| 14 |
+
"etd_token": "<tool|>",
|
| 15 |
+
"etr_token": "<tool_response|>",
|
| 16 |
+
"extra_special_tokens": [
|
| 17 |
+
"<|video|>"
|
| 18 |
+
],
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
+
"mask_token": "<mask>",
|
| 22 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 23 |
+
"model_specific_special_tokens": {
|
| 24 |
+
"audio_token": "<|audio|>",
|
| 25 |
+
"boa_token": "<|audio>",
|
| 26 |
+
"boi_token": "<|image>",
|
| 27 |
+
"eoa_token": "<audio|>",
|
| 28 |
+
"eoc_token": "<channel|>",
|
| 29 |
+
"eoi_token": "<image|>",
|
| 30 |
+
"eot_token": "<turn|>",
|
| 31 |
+
"escape_token": "<|\"|>",
|
| 32 |
+
"etc_token": "<tool_call|>",
|
| 33 |
+
"etd_token": "<tool|>",
|
| 34 |
+
"etr_token": "<tool_response|>",
|
| 35 |
+
"image_token": "<|image|>",
|
| 36 |
+
"soc_token": "<|channel>",
|
| 37 |
+
"sot_token": "<|turn>",
|
| 38 |
+
"stc_token": "<|tool_call>",
|
| 39 |
+
"std_token": "<|tool>",
|
| 40 |
+
"str_token": "<|tool_response>",
|
| 41 |
+
"think_token": "<|think|>"
|
| 42 |
+
},
|
| 43 |
+
"pad_token": "<pad>",
|
| 44 |
+
"padding_side": "left",
|
| 45 |
+
"processor_class": "Gemma4Processor",
|
| 46 |
+
"response_schema": {
|
| 47 |
+
"properties": {
|
| 48 |
+
"content": {
|
| 49 |
+
"type": "string"
|
| 50 |
+
},
|
| 51 |
+
"role": {
|
| 52 |
+
"const": "assistant"
|
| 53 |
+
},
|
| 54 |
+
"thinking": {
|
| 55 |
+
"type": "string"
|
| 56 |
+
},
|
| 57 |
+
"tool_calls": {
|
| 58 |
+
"items": {
|
| 59 |
+
"properties": {
|
| 60 |
+
"function": {
|
| 61 |
+
"properties": {
|
| 62 |
+
"arguments": {
|
| 63 |
+
"additionalProperties": {},
|
| 64 |
+
"type": "object",
|
| 65 |
+
"x-parser": "gemma4-tool-call"
|
| 66 |
+
},
|
| 67 |
+
"name": {
|
| 68 |
+
"type": "string"
|
| 69 |
+
}
|
| 70 |
+
},
|
| 71 |
+
"type": "object",
|
| 72 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 73 |
+
},
|
| 74 |
+
"type": {
|
| 75 |
+
"const": "function"
|
| 76 |
+
}
|
| 77 |
+
},
|
| 78 |
+
"type": "object"
|
| 79 |
+
},
|
| 80 |
+
"type": "array",
|
| 81 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 82 |
+
}
|
| 83 |
+
},
|
| 84 |
+
"type": "object",
|
| 85 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<content>(?:(?!\\<\\|tool_call\\>)(?!\\<turn\\|\\>).)+)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?:\\<turn\\|\\>)?"
|
| 86 |
+
},
|
| 87 |
+
"soc_token": "<|channel>",
|
| 88 |
+
"sot_token": "<|turn>",
|
| 89 |
+
"stc_token": "<|tool_call>",
|
| 90 |
+
"std_token": "<|tool>",
|
| 91 |
+
"str_token": "<|tool_response>",
|
| 92 |
+
"think_token": "<|think|>",
|
| 93 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 94 |
+
"unk_token": "<unk>"
|
| 95 |
+
}
|