bibproj commited on
Commit
5586ed7
·
verified ·
1 Parent(s): 8a86dff
.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 CHANGED
@@ -1,5 +1,7 @@
1
  ---
2
- license: mit
3
- base_model:
4
- - zai-org/GLM-4.7-Flash
5
- ---
 
 
 
1
  ---
2
+ language: en
3
+ pipeline_tag: text-generation
4
+ library_name: mlx
5
+ tags:
6
+ - mlx
7
+ ---
chat_template.jinja ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [gMASK]<sop>
2
+ {%- if tools -%}
3
+ <|system|>
4
+ # Tools
5
+
6
+ You may call one or more functions to assist with the user query.
7
+
8
+ You are provided with function signatures within <tools></tools> XML tags:
9
+ <tools>
10
+ {% for tool in tools %}
11
+ {{ tool | tojson(ensure_ascii=False) }}
12
+ {% endfor %}
13
+ </tools>
14
+
15
+ For each function call, output the function name and arguments within the following XML format:
16
+ <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 -%}
17
+ {%- macro visible_text(content) -%}
18
+ {%- if content is string -%}
19
+ {{- content }}
20
+ {%- elif content is iterable and content is not mapping -%}
21
+ {%- for item in content -%}
22
+ {%- if item is mapping and item.type == 'text' -%}
23
+ {{- item.text }}
24
+ {%- elif item is string -%}
25
+ {{- item }}
26
+ {%- endif -%}
27
+ {%- endfor -%}
28
+ {%- else -%}
29
+ {{- content }}
30
+ {%- endif -%}
31
+ {%- endmacro -%}
32
+ {%- set ns = namespace(last_user_index=-1) %}
33
+ {%- for m in messages %}
34
+ {%- if m.role == 'user' %}
35
+ {% set ns.last_user_index = loop.index0 -%}
36
+ {%- endif %}
37
+ {%- endfor %}
38
+ {% for m in messages %}
39
+ {%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
40
+ {%- elif m.role == 'assistant' -%}
41
+ <|assistant|>
42
+ {%- set reasoning_content = '' %}
43
+ {%- set content = visible_text(m.content) %}
44
+ {%- if m.reasoning_content is string %}
45
+ {%- set reasoning_content = m.reasoning_content %}
46
+ {%- else %}
47
+ {%- if '</think>' in content %}
48
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
49
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
50
+ {%- endif %}
51
+ {%- endif %}
52
+ {%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}
53
+ {{ '<think>' + reasoning_content.strip() + '</think>'}}
54
+ {%- else -%}
55
+ {{ '</think>' }}
56
+ {%- endif -%}
57
+ {%- if content.strip() -%}
58
+ {{ content.strip() }}
59
+ {%- endif -%}
60
+ {% if m.tool_calls %}
61
+ {% for tc in m.tool_calls %}
62
+ {%- if tc.function %}
63
+ {%- set tc = tc.function %}
64
+ {%- endif %}
65
+ {{- '<tool_call>' + tc.name -}}
66
+ {% 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 %}
67
+ {% endif %}
68
+ {%- elif m.role == 'tool' -%}
69
+ {%- if m.content is string -%}
70
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
71
+ {{- '<|observation|>' }}
72
+ {%- endif %}
73
+ {{- '<tool_response>' }}
74
+ {{- m.content }}
75
+ {{- '</tool_response>' }}
76
+ {%- else -%}
77
+ <|observation|>{% for tr in m.content %}
78
+ <tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}
79
+ {% endif -%}
80
+ {%- elif m.role == 'system' -%}
81
+ <|system|>{{ visible_text(m.content) }}
82
+ {%- endif -%}
83
+ {%- endfor -%}
84
+ {%- if add_generation_prompt -%}
85
+ <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
86
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Glm4MoeLiteForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": [
9
+ 154820,
10
+ 154827,
11
+ 154829
12
+ ],
13
+ "first_k_dense_replace": 1,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 2048,
16
+ "intermediate_size": 10240,
17
+ "kv_lora_rank": 512,
18
+ "max_position_embeddings": 202752,
19
+ "model_type": "glm4_moe_lite",
20
+ "moe_intermediate_size": 1536,
21
+ "n_group": 1,
22
+ "n_routed_experts": 64,
23
+ "n_shared_experts": 1,
24
+ "norm_topk_prob": true,
25
+ "num_attention_heads": 20,
26
+ "num_experts_per_tok": 4,
27
+ "num_hidden_layers": 47,
28
+ "num_key_value_heads": 20,
29
+ "num_nextn_predict_layers": 1,
30
+ "pad_token_id": 154820,
31
+ "partial_rotary_factor": 1.0,
32
+ "q_lora_rank": 768,
33
+ "qk_nope_head_dim": 192,
34
+ "qk_rope_head_dim": 64,
35
+ "quantization": {
36
+ "group_size": 32,
37
+ "bits": 8,
38
+ "mode": "affine"
39
+ },
40
+ "quantization_config": {
41
+ "group_size": 32,
42
+ "bits": 8,
43
+ "mode": "affine"
44
+ },
45
+ "rms_norm_eps": 1e-05,
46
+ "rope_scaling": null,
47
+ "rope_theta": 1000000,
48
+ "routed_scaling_factor": 1.8,
49
+ "tie_word_embeddings": false,
50
+ "topk_group": 1,
51
+ "topk_method": "noaux_tc",
52
+ "transformers_version": "5.0.0rc0",
53
+ "v_head_dim": 256,
54
+ "vocab_size": 154880
55
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 154820,
5
+ 154827,
6
+ 154829
7
+ ],
8
+ "pad_token_id": 154820,
9
+ "temperature": 1.0,
10
+ "transformers_version": "5.0.0.dev0"
11
+ }
model-00001-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7c669ab0b83e0dfb3558f98116ade60c72ecb0dd1551aff0ce63d6e06a6bb21
3
+ size 5218680194
model-00002-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7917d75cbfb686cc33b4a873f68ab59942fa92062e3ad616ed635ff3d6cd68e
3
+ size 5265811776
model-00003-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a657302f6ac21a73f34bc9a051ffe4e4236132ddb316e70a38545c1c2483f1f9
3
+ size 5230440619
model-00004-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b668dc0c081b3c0c8d8dad81f9a5af58d1e39ce7e129d9fc1d94467833a7eff1
3
+ size 5230440663
model-00005-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc2fd50855dfccb02ce415eada7773513f6b7c2781f69262fda315e81ee3704c
3
+ size 5265811892
model-00006-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:384c701f7d6846bd246a7866a6f8a50ec44ae2a47dc0b1d61b65760c3549a179
3
+ size 5230440637
model-00007-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b10acba8dd0ebd12bd46c59b7d8239010e4adf57c5ea9568731e342371ec2ca2
3
+ size 2250421980
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad47af68eb0dfcc868258957578831a793a15858b88e2f8325d644fc77f4fb1c
3
+ size 20217424
tokenizer_config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "[MASK]",
5
+ "[gMASK]",
6
+ "[sMASK]",
7
+ "<sop>",
8
+ "<eop>",
9
+ "<|system|>",
10
+ "<|user|>",
11
+ "<|assistant|>",
12
+ "<|observation|>",
13
+ "<|begin_of_image|>",
14
+ "<|end_of_image|>",
15
+ "<|begin_of_video|>",
16
+ "<|end_of_video|>",
17
+ "<|begin_of_audio|>",
18
+ "<|end_of_audio|>",
19
+ "<|begin_of_transcription|>",
20
+ "<|end_of_transcription|>"
21
+ ],
22
+ "backend": "tokenizers",
23
+ "clean_up_tokenization_spaces": false,
24
+ "do_lower_case": false,
25
+ "eos_token": "<|endoftext|>",
26
+ "extra_special_tokens": [
27
+ "<|endoftext|>",
28
+ "[MASK]",
29
+ "[gMASK]",
30
+ "[sMASK]",
31
+ "<sop>",
32
+ "<eop>",
33
+ "<|system|>",
34
+ "<|user|>",
35
+ "<|assistant|>",
36
+ "<|observation|>",
37
+ "<|begin_of_image|>",
38
+ "<|end_of_image|>",
39
+ "<|begin_of_video|>",
40
+ "<|end_of_video|>",
41
+ "<|begin_of_audio|>",
42
+ "<|end_of_audio|>",
43
+ "<|begin_of_transcription|>",
44
+ "<|end_of_transcription|>"
45
+ ],
46
+ "is_local": true,
47
+ "model_max_length": 128000,
48
+ "model_specific_special_tokens": {},
49
+ "pad_token": "<|endoftext|>",
50
+ "padding_side": "left",
51
+ "remove_space": false,
52
+ "tokenizer_class": "TokenizersBackend",
53
+ "tool_parser_type": "glm47"
54
+ }