Update tiny models for Glm5NextForConditionalGeneration
Browse files- .gitattributes +1 -0
- chat_template.jinja +261 -0
- config.json +101 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- preprocessor_config.json +33 -0
- tokenizer.json +3 -0
- tokenizer_config.json +34 -0
- video_preprocessor_config.json +41 -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
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[gMASK]<sop>
|
| 2 |
+
{%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}
|
| 3 |
+
{%- if effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}
|
| 4 |
+
{%- set clear_thinking = clear_thinking if clear_thinking is defined else false -%}
|
| 5 |
+
{%- if tools -%}
|
| 6 |
+
{%- macro tool_to_json(tool) -%}
|
| 7 |
+
{%- set ns_tool = namespace(first=true) -%}
|
| 8 |
+
{{ '{' -}}
|
| 9 |
+
{%- for k, v in tool.items() -%}
|
| 10 |
+
{%- if k != 'defer_loading' and k != 'strict' -%}
|
| 11 |
+
{%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}
|
| 12 |
+
{%- set ns_tool.first = false -%}
|
| 13 |
+
"{{ k }}": {{ v | tojson(ensure_ascii=False) }}
|
| 14 |
+
{%- endif -%}
|
| 15 |
+
{%- endfor -%}
|
| 16 |
+
{{- '}' -}}
|
| 17 |
+
{%- endmacro -%}
|
| 18 |
+
{%- macro tool_references_to_response(refs) -%}
|
| 19 |
+
{{- '<tool_response><tools>\n' -}}
|
| 20 |
+
{%- for tr in refs -%}
|
| 21 |
+
{%- for tool in tools -%}
|
| 22 |
+
{%- if 'function' in tool -%}
|
| 23 |
+
{%- set tool = tool['function'] -%}
|
| 24 |
+
{%- endif -%}
|
| 25 |
+
{%- if tool.name == tr.name -%}
|
| 26 |
+
{{- tool_to_json(tool) + '\n' -}}
|
| 27 |
+
{%- endif -%}
|
| 28 |
+
{%- endfor -%}
|
| 29 |
+
{%- endfor -%}
|
| 30 |
+
{{- '</tools></tool_response>' -}}
|
| 31 |
+
{%- endmacro -%}
|
| 32 |
+
<|system|>
|
| 33 |
+
# Tools
|
| 34 |
+
|
| 35 |
+
You may call one or more functions to assist with the user query.
|
| 36 |
+
|
| 37 |
+
You are provided with function signatures within <tools></tools> XML tags:
|
| 38 |
+
<tools>
|
| 39 |
+
{% for tool in tools %}
|
| 40 |
+
{%- if 'function' in tool -%}
|
| 41 |
+
{%- set tool = tool['function'] -%}
|
| 42 |
+
{%- endif -%}
|
| 43 |
+
{% if tool.defer_loading is not defined or not tool.defer_loading %}
|
| 44 |
+
{{ tool_to_json(tool) }}
|
| 45 |
+
{% endif %}
|
| 46 |
+
{% endfor %}
|
| 47 |
+
</tools>
|
| 48 |
+
|
| 49 |
+
For each function call, output the function name and arguments within the following XML format:
|
| 50 |
+
<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
|
| 51 |
+
{%- macro emit_image() -%}<|begin_of_image|><|image|><|end_of_image|>{%- endmacro -%}
|
| 52 |
+
{%- macro emit_video() -%}<|begin_of_video|><|video|><|end_of_video|>{%- endmacro -%}
|
| 53 |
+
{%- macro emit_audio() -%}<|begin_of_audio|><|end_of_audio|>{%- endmacro -%}
|
| 54 |
+
{%- macro visible_text(content) -%}
|
| 55 |
+
{%- if content is string -%}
|
| 56 |
+
{{- content -}}
|
| 57 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 58 |
+
{%- for item in content -%}
|
| 59 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 60 |
+
{{- item.text -}}
|
| 61 |
+
{%- elif item is string -%}
|
| 62 |
+
{{- item -}}
|
| 63 |
+
{%- elif item is mapping and item.type in ['image', 'image_url'] -%}
|
| 64 |
+
{{- emit_image() -}}
|
| 65 |
+
{%- elif item is mapping and item.type in ['video', 'video_url'] -%}
|
| 66 |
+
{{- emit_video() -}}
|
| 67 |
+
{%- elif item is mapping and item.type in ['audio', 'audio_url', 'input_audio'] -%}
|
| 68 |
+
{{- emit_audio() -}}
|
| 69 |
+
{%- endif -%}
|
| 70 |
+
{%- endfor -%}
|
| 71 |
+
{%- elif content is not none -%}
|
| 72 |
+
{{- content -}}
|
| 73 |
+
{%- endif -%}
|
| 74 |
+
{%- endmacro -%}
|
| 75 |
+
{%- macro tool_response(text) -%}
|
| 76 |
+
{{- '<tool_response>' + text + '</tool_response>' -}}
|
| 77 |
+
{%- endmacro -%}
|
| 78 |
+
{%- macro render_tool_response(m) -%}
|
| 79 |
+
{%- if m.content is string -%}
|
| 80 |
+
{{- tool_response(m.content) -}}
|
| 81 |
+
{%- elif m.content and m.content is not mapping and m.content.0.type == "tool_reference" -%}
|
| 82 |
+
{{- tool_references_to_response(m.content) -}}
|
| 83 |
+
{%- elif is_list_of_outputs(m) -%}
|
| 84 |
+
{%- for tr in m.content -%}
|
| 85 |
+
{%- if tr.output is iterable and tr.output is not string and tr.output is not mapping and tr.output and tr.output.0.type == "tool_reference" -%}
|
| 86 |
+
{{- tool_references_to_response(tr.output) -}}
|
| 87 |
+
{%- else -%}
|
| 88 |
+
{{- tool_response(visible_text(tr.output)) -}}
|
| 89 |
+
{%- endif -%}
|
| 90 |
+
{%- endfor -%}
|
| 91 |
+
{%- else -%}
|
| 92 |
+
{{- tool_response(visible_text(m.content)) -}}
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- endmacro -%}
|
| 95 |
+
{%- macro id_of(obj) -%}
|
| 96 |
+
{%- if obj.tool_call_id -%}
|
| 97 |
+
{{- obj.tool_call_id -}}
|
| 98 |
+
{%- elif obj.id -%}
|
| 99 |
+
{{- obj.id -}}
|
| 100 |
+
{%- endif -%}
|
| 101 |
+
{%- endmacro -%}
|
| 102 |
+
{%- macro is_list_of_outputs(m) -%}
|
| 103 |
+
{%- if m.content and m.content.0.output is defined -%}1{%- endif -%}
|
| 104 |
+
{%- endmacro -%}
|
| 105 |
+
{%- macro has_dup_tool_result_id(lo, hi, target) -%}
|
| 106 |
+
{%- set ns_cnt = namespace(n=0) -%}
|
| 107 |
+
{%- for k in range(lo, hi + 1) -%}
|
| 108 |
+
{%- set m = messages[k] -%}
|
| 109 |
+
{%- if is_list_of_outputs(m) -%}
|
| 110 |
+
{%- for entry in m.content -%}
|
| 111 |
+
{%- if id_of(entry) == target -%}
|
| 112 |
+
{%- set ns_cnt.n = ns_cnt.n + 1 -%}
|
| 113 |
+
{%- endif -%}
|
| 114 |
+
{%- endfor -%}
|
| 115 |
+
{%- elif id_of(m) == target -%}
|
| 116 |
+
{%- set ns_cnt.n = ns_cnt.n + 1 -%}
|
| 117 |
+
{%- endif -%}
|
| 118 |
+
{%- if ns_cnt.n > 1 -%}{%- break -%}{%- endif -%}
|
| 119 |
+
{%- endfor -%}
|
| 120 |
+
{%- if ns_cnt.n > 1 -%}1{%- endif -%}
|
| 121 |
+
{%- endmacro -%}
|
| 122 |
+
{%- macro tc_id_exists(tcs, target) -%}
|
| 123 |
+
{%- set ns_f = namespace(found=false) -%}
|
| 124 |
+
{%- for tc in tcs -%}
|
| 125 |
+
{%- if id_of(tc) == target -%}
|
| 126 |
+
{%- set ns_f.found = true -%}
|
| 127 |
+
{%- break -%}
|
| 128 |
+
{%- endif -%}
|
| 129 |
+
{%- endfor -%}
|
| 130 |
+
{%- if ns_f.found -%}1{%- endif -%}
|
| 131 |
+
{%- endmacro -%}
|
| 132 |
+
{%- set ns = namespace(last_user_index=-1) -%}
|
| 133 |
+
{%- for m in messages %}
|
| 134 |
+
{%- if m.role == 'user' %}
|
| 135 |
+
{%- set ns.last_user_index = loop.index0 -%}
|
| 136 |
+
{%- endif %}
|
| 137 |
+
{%- endfor %}
|
| 138 |
+
{%- for m in messages -%}
|
| 139 |
+
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
|
| 140 |
+
{%- elif m.role == 'assistant' -%}
|
| 141 |
+
<|assistant|>
|
| 142 |
+
{%- set content = visible_text(m.content) %}
|
| 143 |
+
{%- if m.reasoning_content is string %}
|
| 144 |
+
{%- set reasoning_content = m.reasoning_content %}
|
| 145 |
+
{%- elif '</think>' in content %}
|
| 146 |
+
{%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}
|
| 147 |
+
{%- set content = content.split('</think>')[-1] %}
|
| 148 |
+
{%- endif %}
|
| 149 |
+
{%- if (not clear_thinking or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}
|
| 150 |
+
{{ '<think>' + reasoning_content + '</think>'}}
|
| 151 |
+
{%- else -%}
|
| 152 |
+
{{ '<think></think>' }}
|
| 153 |
+
{%- endif -%}
|
| 154 |
+
{%- if content.strip() -%}
|
| 155 |
+
{{ content.strip() }}
|
| 156 |
+
{%- endif -%}
|
| 157 |
+
{% if m.tool_calls %}
|
| 158 |
+
{% for tc in m.tool_calls %}
|
| 159 |
+
{%- if tc.function %}
|
| 160 |
+
{%- set tc = tc.function %}
|
| 161 |
+
{%- endif %}
|
| 162 |
+
{{- '<tool_call>' ~ tc.name -}}
|
| 163 |
+
{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
|
| 164 |
+
{% endif %}
|
| 165 |
+
{%- elif m.role == 'tool' -%}
|
| 166 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 167 |
+
{{- '<|observation|>' -}}
|
| 168 |
+
{%- set block_start = loop.index0 -%}
|
| 169 |
+
{%- set ns_blk = namespace(end=block_start) -%}
|
| 170 |
+
{%- for j in range(block_start, messages|length) -%}
|
| 171 |
+
{%- if messages[j].role == 'tool' -%}
|
| 172 |
+
{%- set ns_blk.end = j -%}
|
| 173 |
+
{%- else -%}
|
| 174 |
+
{%- break -%}
|
| 175 |
+
{%- endif -%}
|
| 176 |
+
{%- endfor -%}
|
| 177 |
+
{%- set ns_a = namespace(tool_calls=none) -%}
|
| 178 |
+
{%- if block_start > 0 and messages[block_start - 1].role == 'assistant' and messages[block_start - 1].tool_calls -%}
|
| 179 |
+
{%- set ns_a.tool_calls = messages[block_start - 1].tool_calls -%}
|
| 180 |
+
{%- endif -%}
|
| 181 |
+
{%- set ns_chk = namespace(can_sort=true) -%}
|
| 182 |
+
{%- if not ns_a.tool_calls -%}
|
| 183 |
+
{%- set ns_chk.can_sort = false -%}
|
| 184 |
+
{%- else -%}
|
| 185 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 186 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 187 |
+
{%- set m = messages[k] -%}
|
| 188 |
+
{%- if is_list_of_outputs(m) -%}
|
| 189 |
+
{%- for entry in m.content -%}
|
| 190 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 191 |
+
{%- set eid = id_of(entry) -%}
|
| 192 |
+
{%- if not eid -%}
|
| 193 |
+
{%- set ns_chk.can_sort = false -%}
|
| 194 |
+
{%- elif has_dup_tool_result_id(block_start, ns_blk.end, eid) -%}
|
| 195 |
+
{%- set ns_chk.can_sort = false -%}
|
| 196 |
+
{%- elif not tc_id_exists(ns_a.tool_calls, eid) -%}
|
| 197 |
+
{%- set ns_chk.can_sort = false -%}
|
| 198 |
+
{%- endif -%}
|
| 199 |
+
{%- endfor -%}
|
| 200 |
+
{%- else -%}
|
| 201 |
+
{%- set tk_id = id_of(m) -%}
|
| 202 |
+
{%- if not tk_id -%}
|
| 203 |
+
{%- set ns_chk.can_sort = false -%}
|
| 204 |
+
{%- elif has_dup_tool_result_id(block_start, ns_blk.end, tk_id) -%}
|
| 205 |
+
{%- set ns_chk.can_sort = false -%}
|
| 206 |
+
{%- elif not tc_id_exists(ns_a.tool_calls, tk_id) -%}
|
| 207 |
+
{%- set ns_chk.can_sort = false -%}
|
| 208 |
+
{%- endif -%}
|
| 209 |
+
{%- endif -%}
|
| 210 |
+
{%- endfor -%}
|
| 211 |
+
{%- for i in range(ns_a.tool_calls | length) -%}
|
| 212 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 213 |
+
{%- set tc_id = id_of(ns_a.tool_calls[i]) -%}
|
| 214 |
+
{%- if not tc_id -%}
|
| 215 |
+
{%- set ns_chk.can_sort = false -%}
|
| 216 |
+
{%- endif -%}
|
| 217 |
+
{%- for j in range(i + 1, ns_a.tool_calls | length) -%}
|
| 218 |
+
{%- if id_of(ns_a.tool_calls[j]) == tc_id -%}
|
| 219 |
+
{%- set ns_chk.can_sort = false -%}
|
| 220 |
+
{%- break -%}
|
| 221 |
+
{%- endif -%}
|
| 222 |
+
{%- endfor -%}
|
| 223 |
+
{%- endfor -%}
|
| 224 |
+
{%- endif -%}
|
| 225 |
+
{%- if ns_chk.can_sort -%}
|
| 226 |
+
{%- for tc in ns_a.tool_calls -%}
|
| 227 |
+
{%- set tc_id = id_of(tc) -%}
|
| 228 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 229 |
+
{%- set m = messages[k] -%}
|
| 230 |
+
{%- if is_list_of_outputs(m) -%}
|
| 231 |
+
{%- for entry in m.content -%}
|
| 232 |
+
{%- set eid = id_of(entry) -%}
|
| 233 |
+
{%- if eid == tc_id -%}
|
| 234 |
+
{%- if entry.output is iterable and entry.output is not string and entry.output is not mapping and entry.output and entry.output.0.type == "tool_reference" -%}
|
| 235 |
+
{{- tool_references_to_response(entry.output) -}}
|
| 236 |
+
{%- else -%}
|
| 237 |
+
{{- tool_response(visible_text(entry.output)) -}}
|
| 238 |
+
{%- endif -%}
|
| 239 |
+
{%- endif -%}
|
| 240 |
+
{%- endfor -%}
|
| 241 |
+
{%- else -%}
|
| 242 |
+
{%- set tk_id = id_of(m) -%}
|
| 243 |
+
{%- if tk_id == tc_id -%}
|
| 244 |
+
{{- render_tool_response(m) -}}
|
| 245 |
+
{%- endif -%}
|
| 246 |
+
{%- endif -%}
|
| 247 |
+
{%- endfor -%}
|
| 248 |
+
{%- endfor -%}
|
| 249 |
+
{%- else -%}
|
| 250 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 251 |
+
{{- render_tool_response(messages[k]) -}}
|
| 252 |
+
{%- endfor -%}
|
| 253 |
+
{%- endif -%}
|
| 254 |
+
{% endif -%}
|
| 255 |
+
{%- elif m.role == 'system' -%}
|
| 256 |
+
<|system|>{{ visible_text(m.content) }}
|
| 257 |
+
{%- endif -%}
|
| 258 |
+
{%- endfor -%}
|
| 259 |
+
{%- if add_generation_prompt -%}
|
| 260 |
+
<|assistant|>{{- '<think>' -}}
|
| 261 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Glm5NextForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"image_end_token_id": 6,
|
| 7 |
+
"image_start_token_id": 5,
|
| 8 |
+
"image_token_id": 7,
|
| 9 |
+
"model_type": "glm5_next",
|
| 10 |
+
"text_config": {
|
| 11 |
+
"attention_bias": false,
|
| 12 |
+
"attention_dropout": 0.0,
|
| 13 |
+
"bos_token_id": 1,
|
| 14 |
+
"eos_token_id": 154820,
|
| 15 |
+
"hc_eps": 1e-06,
|
| 16 |
+
"hc_mult": 4,
|
| 17 |
+
"hc_sinkhorn_iters": 20,
|
| 18 |
+
"head_dim": 0,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 48,
|
| 21 |
+
"index_head_dim": 16,
|
| 22 |
+
"index_kpool": 3,
|
| 23 |
+
"index_kpool_always_select_tail": true,
|
| 24 |
+
"index_n_heads": 2,
|
| 25 |
+
"index_topk": 48,
|
| 26 |
+
"indexer_types": [
|
| 27 |
+
"full",
|
| 28 |
+
"full"
|
| 29 |
+
],
|
| 30 |
+
"initializer_range": 0.02,
|
| 31 |
+
"intermediate_size": 16,
|
| 32 |
+
"kv_lora_rank": 16,
|
| 33 |
+
"layer_types": [
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"indexed_attention"
|
| 36 |
+
],
|
| 37 |
+
"linear_conv_kernel_dim": 2,
|
| 38 |
+
"linear_head_dim": 16,
|
| 39 |
+
"linear_lower_bound": -5.0,
|
| 40 |
+
"linear_num_heads": 2,
|
| 41 |
+
"max_position_embeddings": 512,
|
| 42 |
+
"mlp_layer_types": [
|
| 43 |
+
"dense",
|
| 44 |
+
"sparse"
|
| 45 |
+
],
|
| 46 |
+
"model_type": "glm5_next_text",
|
| 47 |
+
"moe_intermediate_size": 16,
|
| 48 |
+
"n_group": 1,
|
| 49 |
+
"n_routed_experts": 8,
|
| 50 |
+
"n_shared_experts": 1,
|
| 51 |
+
"norm_topk_prob": true,
|
| 52 |
+
"num_attention_heads": 2,
|
| 53 |
+
"num_experts_per_tok": 4,
|
| 54 |
+
"num_hidden_layers": 2,
|
| 55 |
+
"num_key_value_heads": 2,
|
| 56 |
+
"output_router_logits": false,
|
| 57 |
+
"pad_token_id": 154820,
|
| 58 |
+
"q_lora_rank": 32,
|
| 59 |
+
"qk_head_dim": 64,
|
| 60 |
+
"qk_nope_head_dim": 64,
|
| 61 |
+
"qk_rope_head_dim": 0,
|
| 62 |
+
"rms_norm_eps": 1e-05,
|
| 63 |
+
"routed_scaling_factor": 2.5,
|
| 64 |
+
"router_aux_loss_coef": 0.001,
|
| 65 |
+
"swiglu_limit": 10.0,
|
| 66 |
+
"tie_word_embeddings": false,
|
| 67 |
+
"topk_group": 1,
|
| 68 |
+
"use_cache": true,
|
| 69 |
+
"v_head_dim": 16,
|
| 70 |
+
"vocab_size": 154856
|
| 71 |
+
},
|
| 72 |
+
"tie_word_embeddings": false,
|
| 73 |
+
"transformers_version": "5.19.0.dev0",
|
| 74 |
+
"video_end_token_id": 4,
|
| 75 |
+
"video_start_token_id": 3,
|
| 76 |
+
"video_token_id": 8,
|
| 77 |
+
"vision_config": {
|
| 78 |
+
"attention_bias": true,
|
| 79 |
+
"attention_dropout": 0.0,
|
| 80 |
+
"depth": 2,
|
| 81 |
+
"hidden_act": "silu",
|
| 82 |
+
"hidden_size": 48,
|
| 83 |
+
"image_size": 336,
|
| 84 |
+
"in_channels": 3,
|
| 85 |
+
"initializer_range": 0.02,
|
| 86 |
+
"intermediate_size": 16,
|
| 87 |
+
"model_type": "glm5_next_vision",
|
| 88 |
+
"num_heads": 2,
|
| 89 |
+
"out_hidden_size": 48,
|
| 90 |
+
"patch_size": 14,
|
| 91 |
+
"projection_intermediate_size": 144,
|
| 92 |
+
"rms_norm_eps": 1e-05,
|
| 93 |
+
"rope_parameters": {
|
| 94 |
+
"rope_theta": 10000.0,
|
| 95 |
+
"rope_type": "axial"
|
| 96 |
+
},
|
| 97 |
+
"spatial_merge_size": 1,
|
| 98 |
+
"swiglu_limit": 10.0,
|
| 99 |
+
"temporal_patch_size": 2
|
| 100 |
+
}
|
| 101 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 154820,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 154820,
|
| 8 |
+
"transformers_version": "5.19.0.dev0",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb1c4e8bc2c5bd595f4cdb06a91c7afe7b71bf8f544f72f8418c0a16fb674c2e
|
| 3 |
+
size 60160504
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"crop_size": {
|
| 3 |
+
"longest_edge": 336,
|
| 4 |
+
"shortest_edge": 336
|
| 5 |
+
},
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.48145466,
|
| 12 |
+
0.4578275,
|
| 13 |
+
0.40821073
|
| 14 |
+
],
|
| 15 |
+
"image_processor_type": "Glm5NextImageProcessor",
|
| 16 |
+
"image_std": [
|
| 17 |
+
0.26862954,
|
| 18 |
+
0.26130258,
|
| 19 |
+
0.27577711
|
| 20 |
+
],
|
| 21 |
+
"max_image_tokens": 8000,
|
| 22 |
+
"merge_size": 2,
|
| 23 |
+
"min_image_tokens": 16,
|
| 24 |
+
"patch_expand_factor": 1,
|
| 25 |
+
"patch_size": 14,
|
| 26 |
+
"resample": 3,
|
| 27 |
+
"rescale_factor": 0.00392156862745098,
|
| 28 |
+
"size": {
|
| 29 |
+
"longest_edge": 336,
|
| 30 |
+
"shortest_edge": 336
|
| 31 |
+
},
|
| 32 |
+
"temporal_patch_size": 2
|
| 33 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19e773648cb4e65de8660ea6365e10acca112d42a854923df93db4a6f333a82d
|
| 3 |
+
size 20217442
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": false,
|
| 4 |
+
"do_lower_case": false,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|endoftext|>",
|
| 8 |
+
"[MASK]",
|
| 9 |
+
"[gMASK]",
|
| 10 |
+
"[sMASK]",
|
| 11 |
+
"<sop>",
|
| 12 |
+
"<eop>",
|
| 13 |
+
"<|system|>",
|
| 14 |
+
"<|user|>",
|
| 15 |
+
"<|assistant|>",
|
| 16 |
+
"<|observation|>",
|
| 17 |
+
"<|begin_of_image|>",
|
| 18 |
+
"<|end_of_image|>",
|
| 19 |
+
"<|begin_of_video|>",
|
| 20 |
+
"<|end_of_video|>",
|
| 21 |
+
"<|begin_of_audio|>",
|
| 22 |
+
"<|end_of_audio|>",
|
| 23 |
+
"<|begin_of_transcription|>",
|
| 24 |
+
"<|end_of_transcription|>"
|
| 25 |
+
],
|
| 26 |
+
"is_local": true,
|
| 27 |
+
"local_files_only": false,
|
| 28 |
+
"model_max_length": 1048576,
|
| 29 |
+
"model_specific_special_tokens": {},
|
| 30 |
+
"pad_token": "<|endoftext|>",
|
| 31 |
+
"padding_side": "left",
|
| 32 |
+
"remove_space": false,
|
| 33 |
+
"tokenizer_class": "TokenizersBackend"
|
| 34 |
+
}
|
video_preprocessor_config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"crop_size": {
|
| 3 |
+
"longest_edge": 336,
|
| 4 |
+
"shortest_edge": 336
|
| 5 |
+
},
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"do_sample_frames": true,
|
| 11 |
+
"fps": 2,
|
| 12 |
+
"image_mean": [
|
| 13 |
+
0.48145466,
|
| 14 |
+
0.4578275,
|
| 15 |
+
0.40821073
|
| 16 |
+
],
|
| 17 |
+
"image_std": [
|
| 18 |
+
0.26862954,
|
| 19 |
+
0.26130258,
|
| 20 |
+
0.27577711
|
| 21 |
+
],
|
| 22 |
+
"max_frames": 2048,
|
| 23 |
+
"max_image_size": {
|
| 24 |
+
"longest_edge": 47040000
|
| 25 |
+
},
|
| 26 |
+
"max_image_tokens": 240000,
|
| 27 |
+
"merge_size": 2,
|
| 28 |
+
"min_image_tokens": 16,
|
| 29 |
+
"num_frames": 16,
|
| 30 |
+
"patch_expand_factor": 1,
|
| 31 |
+
"patch_size": 14,
|
| 32 |
+
"resample": 3,
|
| 33 |
+
"rescale_factor": 0.00392156862745098,
|
| 34 |
+
"return_metadata": false,
|
| 35 |
+
"size": {
|
| 36 |
+
"longest_edge": 336,
|
| 37 |
+
"shortest_edge": 336
|
| 38 |
+
},
|
| 39 |
+
"temporal_patch_size": 2,
|
| 40 |
+
"video_processor_type": "Glm5NextVideoProcessor"
|
| 41 |
+
}
|