JunHowie commited on
Commit
ad84a3a
·
verified ·
1 Parent(s): 1597dd5

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. .mdl +0 -0
  2. .msc +0 -0
  3. .mv +1 -0
  4. README.md +287 -0
  5. chat_template.jinja +86 -0
  6. config.json +52 -0
  7. configuration.json +1 -0
  8. generation_config.json +11 -0
  9. model-00001-of-00065.safetensors +3 -0
  10. model-00002-of-00065.safetensors +3 -0
  11. model-00003-of-00065.safetensors +3 -0
  12. model-00004-of-00065.safetensors +3 -0
  13. model-00005-of-00065.safetensors +3 -0
  14. model-00006-of-00065.safetensors +3 -0
  15. model-00007-of-00065.safetensors +3 -0
  16. model-00008-of-00065.safetensors +3 -0
  17. model-00009-of-00065.safetensors +3 -0
  18. model-00010-of-00065.safetensors +3 -0
  19. model-00011-of-00065.safetensors +3 -0
  20. model-00012-of-00065.safetensors +3 -0
  21. model-00013-of-00065.safetensors +3 -0
  22. model-00014-of-00065.safetensors +3 -0
  23. model-00015-of-00065.safetensors +3 -0
  24. model-00016-of-00065.safetensors +3 -0
  25. model-00017-of-00065.safetensors +3 -0
  26. model-00018-of-00065.safetensors +3 -0
  27. model-00019-of-00065.safetensors +3 -0
  28. model-00020-of-00065.safetensors +3 -0
  29. model-00021-of-00065.safetensors +3 -0
  30. model-00022-of-00065.safetensors +3 -0
  31. model-00023-of-00065.safetensors +3 -0
  32. model-00024-of-00065.safetensors +3 -0
  33. model-00025-of-00065.safetensors +3 -0
  34. model-00026-of-00065.safetensors +3 -0
  35. model-00027-of-00065.safetensors +3 -0
  36. model-00028-of-00065.safetensors +3 -0
  37. model-00029-of-00065.safetensors +3 -0
  38. model-00030-of-00065.safetensors +3 -0
  39. model-00031-of-00065.safetensors +3 -0
  40. model-00032-of-00065.safetensors +3 -0
  41. model-00033-of-00065.safetensors +3 -0
  42. model-00034-of-00065.safetensors +3 -0
  43. model-00035-of-00065.safetensors +3 -0
  44. model-00036-of-00065.safetensors +3 -0
  45. model-00038-of-00065.safetensors +3 -0
  46. model-00039-of-00065.safetensors +3 -0
  47. model-00040-of-00065.safetensors +3 -0
  48. model-00041-of-00065.safetensors +3 -0
  49. model-00042-of-00065.safetensors +3 -0
  50. model-00044-of-00065.safetensors +3 -0
.mdl ADDED
Binary file (43 Bytes). View file
 
.msc ADDED
Binary file (6.21 kB). View file
 
.mv ADDED
@@ -0,0 +1 @@
 
 
1
+ Revision:master,CreatedAt:1766543923
README.md ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - vLLM
7
+ - AWQ
8
+ base_model:
9
+ - ZhipuAI/GLM-4.7
10
+ base_model_relation: quantized
11
+
12
+ ---
13
+ # GLM-4.7-AWQ
14
+ Base model: [ZhipuAI/GLM-4.7](https://www.modelscope.cn/models/ZhipuAI/GLM-4.7)
15
+
16
+
17
+ ### 【Dependencies / Installation】
18
+
19
+ ```python
20
+ vllm==0.14.0
21
+ ```
22
+
23
+ As of **2025-12-24**, make sure your system has cuda12.8 installed.
24
+
25
+ Then, create a fresh Python environment (e.g. python3.12 venv) and run:
26
+ ```bash
27
+ pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
28
+ ```
29
+
30
+ ### 【vLLM Startup Command】
31
+ <i>Note: When launching with TP=8, include `--enable-expert-parallel`;
32
+ otherwise the expert tensors couldn’t be evenly sharded across GPU devices.</i>
33
+
34
+ ```
35
+ export VLLM_USE_DEEP_GEMM=0
36
+ export VLLM_USE_FLASHINFER_MOE_FP16=1
37
+ export VLLM_USE_FLASHINFER_SAMPLER=0
38
+ export OMP_NUM_THREADS=4
39
+
40
+ vllm serve \
41
+ __YOUR_PATH__/tclf90/GLM-4.7-AWQ \
42
+ --served-model-name MY_MODEL_NAME \
43
+ --swap-space 16 \
44
+ --max-num-seqs 32 \
45
+ --max-model-len 32768 \
46
+ --gpu-memory-utilization 0.9 \
47
+ --tensor-parallel-size 8 \
48
+ --enable-expert-parallel \
49
+ --speculative-config.method mtp \
50
+ --speculative-config.num_speculative_tokens 1 \
51
+ --tool-call-parser glm47 \
52
+ --reasoning-parser glm45 \
53
+ --enable-auto-tool-choice \
54
+ --trust-remote-code \
55
+ --host 0.0.0.0 \
56
+ --port 8000
57
+ ```
58
+
59
+ ### 【Logs】
60
+ ```
61
+ 2025-12-24
62
+ 1. Initial commit
63
+ ```
64
+
65
+ ### 【Model Files】
66
+ | File Size | Last Updated |
67
+ |-----------|--------------|
68
+ | `181 GiB` | `2025-12-24` |
69
+
70
+ ### 【Model Download】
71
+ ```python
72
+ from modelscope import snapshot_download
73
+ snapshot_download('tclf90/GLM-4.7-AWQ', cache_dir="your_local_path")
74
+ ```
75
+
76
+ ### 【Overview】
77
+ # GLM-4.7
78
+
79
+ <div align="center">
80
+ <img src=https://raw.githubusercontent.com/zai-org/GLM-4.5/refs/heads/main/resources/logo.svg width="15%"/>
81
+ </div>
82
+ <p align="center">
83
+ 👋 Join our <a href="https://discord.gg/QR7SARHRxK" target="_blank">Discord</a> community.
84
+ <br>
85
+ 📖 Check out the GLM-4.7 <a href="https://z.ai/blog/glm-4.7" target="_blank">technical blog</a>, <a href="https://arxiv.org/abs/2508.06471" target="_blank">technical report(GLM-4.5)</a>.
86
+ <br>
87
+ 📍 Use GLM-4.7 API services on <a href="https://docs.z.ai/guides/llm/glm-4.7">Z.ai API Platform. </a>
88
+ <br>
89
+ 👉 One click to <a href="https://chat.z.ai">GLM-4.7</a>.
90
+ </p>
91
+
92
+ ## Introduction
93
+
94
+ **GLM-4.7**, your new coding partner, is coming with the following features:
95
+
96
+ - **Core Coding**: GLM-4.7 brings clear gains, compared to its predecessor GLM-4.6, in multilingual agentic coding and terminal-based tasks, including (73.8%, +5.8%) on SWE-bench, (66.7%, +12.9%) on SWE-bench Multilingual, and (41%, +16.5%) on Terminal Bench 2.0. GLM-4.7 also supports thinking before acting, with significant improvements on complex tasks in mainstream agent frameworks such as Claude Code, Kilo Code, Cline, and Roo Code.
97
+ - **Vibe Coding**: GLM-4.7 takes a big step forward in improving UI quality. It produces cleaner, more modern webpages and generates better-looking slides with more accurate layout and sizing.
98
+ - **Tool Using**: GLM-4.7 achieves significantly improvements in Tool using. Significant better performances can be seen on benchmarks such as τ^2-Bench and on web browsing via BrowseComp.
99
+ - **Complex Reasoning**: GLM-4.7 delivers a substantial boost in mathematical and reasoning capabilities, achieving (42.8%, +12.4%) on the HLE (Humanity’s Last Exam) benchmark compared to GLM-4.6.
100
+
101
+ You can also see significant improvements in many other scenarios such as chat, creative writing, and role-play scenario.
102
+
103
+ ![bench](https://raw.githubusercontent.com/zai-org/GLM-4.5/refs/heads/main/resources/bench_glm47.png)
104
+
105
+ **Performances on Benchmarks.** More detailed comparisons of GLM-4.7 with other models GPT-5-High, GPT-5.1-High, Claude Sonnet 4.5, Gemini 3.0 Pro, DeepSeek-V3.2, Kimi K2 Thinking, on 17 benchmarks (including 8 reasoning, 5 coding, and 3 agents benchmarks) can be seen in the below table.
106
+
107
+ | Benchmark | GLM-4.7 | GLM-4.6 | Kimi K2 Thinking | DeepSeek-V3.2 | Gemini 3.0 Pro | Claude Sonnet 4.5 | GPT-5-High | GPT-5.1-High |
108
+ |:-------------------------------|:-------:|:-------:|:----------------:|:-------------:|:--------------:|:-----------------:|:----------:|:------------:|
109
+ | MMLU-Pro | 84.3 | 83.2 | 84.6 | 85.0 | 90.1 | 88.2 | 87.5 | 87.0 |
110
+ | GPQA-Diamond | 85.7 | 81.0 | 84.5 | 82.4 | 91.9 | 83.4 | 85.7 | 88.1 |
111
+ | HLE | 24.8 | 17.2 | 23.9 | 25.1 | 37.5 | 13.7 | 26.3 | 25.7 |
112
+ | HLE (w/ Tools) | 42.8 | 30.4 | 44.9 | 40.8 | 45.8 | 32.0 | 35.2 | 42.7 |
113
+ | AIME 2025 | 95.7 | 93.9 | 94.5 | 93.1 | 95.0 | 87.0 | 94.6 | 94.0 |
114
+ | HMMT Feb. 2025 | 97.1 | 89.2 | 89.4 | 92.5 | 97.5 | 79.2 | 88.3 | 96.3 |
115
+ | HMMT Nov. 2025 | 93.5 | 87.7 | 89.2 | 90.2 | 93.3 | 81.7 | 89.2 | - |
116
+ | IMOAnswerBench | 82.0 | 73.5 | 78.6 | 78.3 | 83.3 | 65.8 | 76.0 | - |
117
+ | LiveCodeBench-v6 | 84.9 | 82.8 | 83.1 | 83.3 | 90.7 | 64.0 | 87.0 | 87.0 |
118
+ | SWE-bench Verified | 73.8 | 68.0 | 71.3 | 73.1 | 76.2 | 77.2 | 74.9 | 76.3 |
119
+ | SWE-bench Multilingual | 66.7 | 53.8 | 61.1 | 70.2 | - | 68.0 | 55.3 | - |
120
+ | Terminal Bench Hard | 33.3 | 23.6 | 30.6 | 35.4 | 39.0 | 33.3 | 30.5 | 43.0 |
121
+ | Terminal Bench 2.0 | 41.0 | 24.5 | 35.7 | 46.4 | 54.2 | 42.8 | 35.2 | 47.6 |
122
+ | BrowseComp | 52.0 | 45.1 | - | 51.4 | - | 24.1 | 54.9 | 50.8 |
123
+ | BrowseComp (w/ Context Manage) | 67.5 | 57.5 | 60.2 | 67.6 | 59.2 | - | - | - |
124
+ | BrowseComp-Zh | 66.6 | 49.5 | 62.3 | 65.0 | - | 42.4 | 63.0 | - |
125
+ | τ²-Bench | 87.4 | 75.2 | 74.3 | 85.3 | 90.7 | 87.2 | 82.4 | 82.7 |
126
+
127
+ > **Coding:** AGI is a long journey, and benchmarks are only one way to evaluate performance. While the metrics provide necessary checkpoints, the most important thing is still how it *feels*. True intelligence isn't just about acing a test or processing data faster; ultimately, the success of AGI will be measured by how seamlessly it integrates into our lives-**"coding"** this time.
128
+
129
+
130
+ ## Getting started with GLM-4.7
131
+
132
+ ### Interleaved Thinking & Preserved Thinking
133
+
134
+ ![bench](https://raw.githubusercontent.com/zai-org/GLM-4.5/refs/heads/main/resources/thinking.png)
135
+
136
+ GLM-4.7 further enhances **Interleaved Thinking** (a feature introduced since GLM-4.5) and introduces **Preserved Thinking** and **Turn-level Thinking**. By thinking between actions and staying consistent across turns, it makes complex tasks more stable and more controllable:
137
+ - **Interleaved Thinking**: The model thinks before every response and tool calling, improving instruction following and the quality of generation.
138
+ - **Preserved Thinking**: In coding agent scenarios, the model automatically retains all thinking blocks across multi-turn conversations, reusing the existing reasoning instead of re-deriving from scratch. This reduces information loss and inconsistencies, and is well-suited for long-horizon, complex tasks.
139
+ - **Turn-level Thinking**: The model supports per-turn control over reasoning within a session—disable thinking for lightweight requests to reduce latency/cost, enable it for complex tasks to improve accuracy and stability.
140
+
141
+ More details: https://docs.z.ai/guides/capabilities/thinking-mode
142
+
143
+ ### Evaluation Parameters
144
+
145
+ **Default Settings (Most Tasks)**
146
+
147
+ * temperature: `1.0`
148
+ * top-p: `0.95`
149
+ * max new tokens: `131072`
150
+
151
+ For multi-turn agentic tasks (τ²-Bench and Terminal Bench 2), please turn on [Preserved Thinking mode](https://docs.z.ai/guides/capabilities/thinking-mode).
152
+
153
+ **Terminal Bench, SWE Bench Verified**
154
+
155
+ * temperature: `0.7`
156
+ * top-p: `1.0`
157
+ * max new tokens: `16384`
158
+
159
+ **τ^2-Bench**
160
+
161
+ * Temperature: `0`
162
+ * Max new tokens: `16384`
163
+
164
+ For τ^2-Bench evaluation, we added an additional prompt to the Retail and Telecom user interaction to avoid failure modes caused by users ending the interaction incorrectly. For the Airline domain, we applied the domain fixes as proposed in the [Claude Opus 4.5](https://assets.anthropic.com/m/64823ba7485345a7/Claude-Opus-4-5-System-Card.pdf) release report.
165
+
166
+ ## Serve GLM-4.7 Locally
167
+
168
+ For local deployment, GLM-4.7 supports inference frameworks including vLLM and SGLang. Comprehensive deployment instructions are available in the official [Github](https://github.com/zai-org/GLM-4.5) repository.
169
+
170
+
171
+ vLLM and SGLang only support GLM-4.7 on their main branches. you can use their official docker images for inference.
172
+
173
+ ### vLLM
174
+
175
+ Using Docker as:
176
+
177
+ ```shell
178
+ docker pull vllm/vllm-openai:nightly
179
+ ```
180
+
181
+ or using pip (must use pypi.org as the index url):
182
+
183
+ ```shell
184
+ pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
185
+ ```
186
+
187
+ ### SGLang
188
+
189
+ Using Docker as:
190
+
191
+ ```shell
192
+ docker pull lmsysorg/sglang:dev
193
+ ```
194
+
195
+ or using pip install sglang from source.
196
+
197
+
198
+ ### transformers
199
+
200
+ using with transformers as `4.57.3` and then run:
201
+
202
+ ```python
203
+ import torch
204
+ from transformers import AutoModelForCausalLM, AutoTokenizer
205
+
206
+ MODEL_PATH = "zai-org/GLM-4.7"
207
+ messages = [{"role": "user", "content": "hello"}]
208
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
209
+ inputs = tokenizer.apply_chat_template(
210
+ messages,
211
+ tokenize=True,
212
+ add_generation_prompt=True,
213
+ return_dict=True,
214
+ return_tensors="pt",
215
+ )
216
+ model = AutoModelForCausalLM.from_pretrained(
217
+ pretrained_model_name_or_path=MODEL_PATH,
218
+ torch_dtype=torch.bfloat16,
219
+ device_map="auto",
220
+ )
221
+ inputs = inputs.to(model.device)
222
+ generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
223
+ output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
224
+ print(output_text)
225
+ ```
226
+
227
+ ### vLLM
228
+
229
+ ```shell
230
+ vllm serve zai-org/GLM-4.7-FP8 \
231
+ --tensor-parallel-size 4 \
232
+ --speculative-config.method mtp \
233
+ --speculative-config.num_speculative_tokens 1 \
234
+ --tool-call-parser glm47 \
235
+ --reasoning-parser glm45 \
236
+ --enable-auto-tool-choice \
237
+ --served-model-name glm-4.7-fp8
238
+ ```
239
+
240
+ ### SGLang
241
+
242
+ ```shell
243
+ python3 -m sglang.launch_server \
244
+ --model-path zai-org/GLM-4.7-FP8 \
245
+ --tp-size 8 \
246
+ --tool-call-parser glm47 \
247
+ --reasoning-parser glm45 \
248
+ --speculative-algorithm EAGLE \
249
+ --speculative-num-steps 3 \
250
+ --speculative-eagle-topk 1 \
251
+ --speculative-num-draft-tokens 4 \
252
+ --mem-fraction-static 0.8 \
253
+ --served-model-name glm-4.7-fp8 \
254
+ --host 0.0.0.0 \
255
+ --port 8000
256
+ ```
257
+
258
+ ### Parameter Instructions
259
+
260
+ - For agentic tasks of GLM-4.7, please turn on [Preserved Thinking mode](https://docs.z.ai/guides/capabilities/thinking-mode) by adding the following config (only sglang support):
261
+
262
+ ```
263
+ "chat_template_kwargs": {
264
+ "enable_thinking": true,
265
+ "clear_thinking": false
266
+ }
267
+ ```
268
+
269
+ - When using `vLLM` and `SGLang`, thinking mode is enabled by default when sending requests. If you want to disable the thinking switch, you need to add the `extra_body={"chat_template_kwargs": {"enable_thinking": False}}` parameter.
270
+ - Both support tool calling. Please use OpenAI-style tool description format for calls.
271
+
272
+
273
+ ## Citation
274
+
275
+ If you find our work useful in your research, please consider citing the following paper:
276
+
277
+ ```bibtex
278
+ @misc{5team2025glm45agenticreasoningcoding,
279
+ title={GLM-4.5: Agentic, Reasoning, and Coding (ARC) Foundation Models},
280
+ author={GLM Team and Aohan Zeng and Xin Lv and Qinkai Zheng and Zhenyu Hou and Bin Chen and Chengxing Xie and Cunxiang Wang and Da Yin and Hao Zeng and Jiajie Zhang and Kedong Wang and Lucen Zhong and Mingdao Liu and Rui Lu and Shulin Cao and Xiaohan Zhang and Xuancheng Huang and Yao Wei and Yean Cheng and Yifan An and Yilin Niu and Yuanhao Wen and Yushi Bai and Zhengxiao Du and Zihan Wang and Zilin Zhu and Bohan Zhang and Bosi Wen and Bowen Wu and Bowen Xu and Can Huang and Casey Zhao and Changpeng Cai and Chao Yu and Chen Li and Chendi Ge and Chenghua Huang and Chenhui Zhang and Chenxi Xu and Chenzheng Zhu and Chuang Li and Congfeng Yin and Daoyan Lin and Dayong Yang and Dazhi Jiang and Ding Ai and Erle Zhu and Fei Wang and Gengzheng Pan and Guo Wang and Hailong Sun and Haitao Li and Haiyang Li and Haiyi Hu and Hanyu Zhang and Hao Peng and Hao Tai and Haoke Zhang and Haoran Wang and Haoyu Yang and He Liu and He Zhao and Hongwei Liu and Hongxi Yan and Huan Liu and Huilong Chen and Ji Li and Jiajing Zhao and Jiamin Ren and Jian Jiao and Jiani Zhao and Jianyang Yan and Jiaqi Wang and Jiayi Gui and Jiayue Zhao and Jie Liu and Jijie Li and Jing Li and Jing Lu and Jingsen Wang and Jingwei Yuan and Jingxuan Li and Jingzhao Du and Jinhua Du and Jinxin Liu and Junkai Zhi and Junli Gao and Ke Wang and Lekang Yang and Liang Xu and Lin Fan and Lindong Wu and Lintao Ding and Lu Wang and Man Zhang and Minghao Li and Minghuan Xu and Mingming Zhao and Mingshu Zhai and Pengfan Du and Qian Dong and Shangde Lei and Shangqing Tu and Shangtong Yang and Shaoyou Lu and Shijie Li and Shuang Li and Shuang-Li and Shuxun Yang and Sibo Yi and Tianshu Yu and Wei Tian and Weihan Wang and Wenbo Yu and Weng Lam Tam and Wenjie Liang and Wentao Liu and Xiao Wang and Xiaohan Jia and Xiaotao Gu and Xiaoying Ling and Xin Wang and Xing Fan and Xingru Pan and Xinyuan Zhang and Xinze Zhang and Xiuqing Fu and Xunkai Zhang and Yabo Xu and Yandong Wu and Yida Lu and Yidong Wang and Yilin Zhou and Yiming Pan and Ying Zhang and Yingli Wang and Yingru Li and Yinpei Su and Yipeng Geng and Yitong Zhu and Yongkun Yang and Yuhang Li and Yuhao Wu and Yujiang Li and Yunan Liu and Yunqing Wang and Yuntao Li and Yuxuan Zhang and Zezhen Liu and Zhen Yang and Zhengda Zhou and Zhongpei Qiao and Zhuoer Feng and Zhuorui Liu and Zichen Zhang and Zihan Wang and Zijun Yao and Zikang Wang and Ziqiang Liu and Ziwei Chai and Zixuan Li and Zuodong Zhao and Wenguang Chen and Jidong Zhai and Bin Xu and Minlie Huang and Hongning Wang and Juanzi Li and Yuxiao Dong and Jie Tang},
281
+ year={2025},
282
+ eprint={2508.06471},
283
+ archivePrefix={arXiv},
284
+ primaryClass={cs.CL},
285
+ url={https://arxiv.org/abs/2508.06471},
286
+ }
287
+
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,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name_or_path": "tclf90/GLM-4.7-AWQ",
3
+ "architectures": [
4
+ "Glm4MoeForCausalLM"
5
+ ],
6
+ "attention_bias": true,
7
+ "attention_dropout": 0.0,
8
+ "pad_token_id": 151329,
9
+ "eos_token_id": [
10
+ 151329,
11
+ 151336,
12
+ 151338
13
+ ],
14
+ "head_dim": 128,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 5120,
17
+ "partial_rotary_factor": 0.5,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 12288,
20
+ "max_position_embeddings": 202752,
21
+ "model_type": "glm4_moe",
22
+ "moe_intermediate_size": 1536,
23
+ "norm_topk_prob": true,
24
+ "num_attention_heads": 96,
25
+ "n_group": 1,
26
+ "topk_group": 1,
27
+ "n_routed_experts": 160,
28
+ "n_shared_experts": 1,
29
+ "routed_scaling_factor": 2.5,
30
+ "num_experts_per_tok": 8,
31
+ "first_k_dense_replace": 3,
32
+ "num_hidden_layers": 92,
33
+ "num_key_value_heads": 8,
34
+ "rms_norm_eps": 1e-05,
35
+ "rope_scaling": null,
36
+ "rope_theta": 1000000,
37
+ "num_nextn_predict_layers": 1,
38
+ "tie_word_embeddings": false,
39
+ "torch_dtype": "float16",
40
+ "transformers_version": "4.54.0",
41
+ "use_cache": true,
42
+ "use_qk_norm": true,
43
+ "vocab_size": 151552,
44
+ "quantization_config": {
45
+ "quant_method": "awq",
46
+ "bits": 4,
47
+ "group_size": 128,
48
+ "version": "gemm",
49
+ "zero_point": true,
50
+ "modules_to_not_convert": ["embed_tokens", "shared_experts", "shared_head", "lm_head"]
51
+ }
52
+ }
configuration.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"framework":"Pytorch","task":"text-generation"}
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 151329,
5
+ 151336,
6
+ 151338
7
+ ],
8
+ "pad_token_id": 151329,
9
+ "temperature": 1.0,
10
+ "transformers_version": "4.56.2"
11
+ }
model-00001-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55d35b2f8764ee4b1c6045e1d698af4b05b4fa42501b26f8600bc0b9491a11f1
3
+ size 2998504328
model-00002-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cad4b244dcc07483c3d337fec6c2174c570b6f684e77ce3c717cc07e78de55b3
3
+ size 2996328520
model-00003-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0ad826315b3656bc0cffce1b33fabf524ceaf0c5411bb6e7dbaca04a8dda30d
3
+ size 2997528648
model-00004-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad5edaca5fb969a98187c284d34fb22672f53bf4a4514857db1325570cc1df3e
3
+ size 2996328616
model-00005-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f226aa7aca5322a9b9868a6c900af8df025e0592c732845a7134575082257f7
3
+ size 2997528456
model-00006-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3964de37b82a02d5ffa023b886bbba5d14c6bd696714e45ba47a518fac83a30a
3
+ size 2996329816
model-00007-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae0187125d3cdf3d36997adc7c64a41fdecc2b0fb3d091c131d75206dc9ba584
3
+ size 2997530344
model-00008-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:615b1679e84aeeba6344e86daed42ea3cc084ae5d887738354d6059fcdfb1c92
3
+ size 2996331128
model-00009-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67c164fc48a338ef3303729de28b53c93fba2c299d31be38ee64e9c716729512
3
+ size 2986601424
model-00010-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3925d4e6c495c5baef2b56a3640f195b28fc8fd4aa6ecfddb6a59c04a9ddae9
3
+ size 2999087920
model-00011-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c4659b6fbbcfc3d334f4209c4e1ffecc8d0ec66eb01d9119e09f32f8208f7c9
3
+ size 2996330648
model-00012-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a807620582b746a074e47c47f73cbf8125ceb53b9a3cfa6dd9b73e7937a443e
3
+ size 2997530640
model-00013-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5479e90626597ad3acb0b5454f801c9de60ce22058b1705861f63dfb719aad0e
3
+ size 2996330840
model-00014-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9589a7c022757a18db825616e6d1bf8043f3ae5885770469786f98a13ddbbde9
3
+ size 2997530464
model-00015-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec2cb2b14a8c1df9d6b923ae6f785fec9ba690db596bbaa4b41ae20384a4e728
3
+ size 2996331016
model-00016-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c62e32e88c8e18bbd73308aff531ffe00da18505c7bc839278bdad09c4e9443
3
+ size 2997530280
model-00017-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2448e0f9a305110b1fa3816cb60a4c10c962adf1361a75f26637ad7f7d0fafc8
3
+ size 2996331200
model-00018-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f65f63491c924ad87ee16af89423d9c4deb09e1c22f5b4fc85fef4c5143ea4b9
3
+ size 2996330712
model-00019-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1c2ae90e97997f5114a2dbd453115a6d3cb54ddff3bb419b3d21837a94cd97e
3
+ size 2997530824
model-00020-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61740f7bb23abd1b0668b78fb556e58cd768dd99d52f1538e16fa09fa9fca343
3
+ size 2996330704
model-00021-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15e9037312193b1bbf83fba2e9b12e496bfc61cf6d3df37487a46d1e0e23e416
3
+ size 2997530584
model-00022-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:879d09d36ba0a40559f354a2d0d9d93e79446c3bd9290fda1a00689ff4259f30
3
+ size 2996330880
model-00023-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:daf1a19af89c572d8be166ef4c21b7cc98105a7b187bf0cfc7694013670df42d
3
+ size 2997530408
model-00024-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abf2a1c2c245ea4bdece8a05100400d12c857c1ef715917a4798a3fc010531cd
3
+ size 2996331072
model-00025-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16350ec6ae1b8868763bc139cb76173c046ed6f4fb3bdc352a85e584ee105bdc
3
+ size 2997530232
model-00026-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b2ccd5205f9c0a09b24d036f7102128574b510022b32f00a36a94f1c8277e5d
3
+ size 2996331240
model-00027-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15fce2ec5951f2360f61ceda49ef3d7a837850ee4e61cbf296bed53de8212d71
3
+ size 2996330648
model-00028-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cc8f9135d9c7b164873ebcdb42400fe492fc1e313a807748a592af6547ef3fd
3
+ size 2997530712
model-00029-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e85796100d267478430bfc2b2718bde7a5f41dfb65f28c54c901564d78f379b
3
+ size 2996330768
model-00030-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70e1084a79a2f691d9aa40c7e042e91292d08338e83e4f0a6f92d24a334c79ae
3
+ size 2997530528
model-00031-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98aaba80d12f7dae5b6412240030ad1627bf9a4ed07860644e274456b0dcc5e6
3
+ size 2996330944
model-00032-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3890f438f8c193e1db61d380082bffe52c2ab816707b436afc8aa3d32ea1590c
3
+ size 2997530344
model-00033-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:180169a0965fa962d87bd71ec094aed5f84fe5b2ab85d964485bc21746653975
3
+ size 2996331136
model-00034-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d91be18b3fcfef4fc2de3bfaa566f4c45e26a3f18257244b770abeb05168e94a
3
+ size 2990687552
model-00035-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:164eccef40af821d52f921bbd0ff53e2b1f1e4aafad1f3d723c61cd540a00cbb
3
+ size 2999087920
model-00036-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00048a831709189d5b3cee82aeddaeccf8019e7913163218408d42acd3d40c4a
3
+ size 2996330648
model-00038-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fe45f4e4bea295067f03c48964cd1bbd981e92810f197d3ab36e90fa8c92d2d
3
+ size 2996330840
model-00039-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5b47ea81bc429992d812a5ada9517e712bf5d1524950d5004d0b2c66c71572f
3
+ size 2997530464
model-00040-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e3c9772136bd6c14608987fa27ad059d9b4e85008bb00806a403799d4d005d3
3
+ size 2996331016
model-00041-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a74bbaec37f782ea5a514e3d9f9134c39aba0af7203e1194d1f25ab7b2a8ff6
3
+ size 2997530280
model-00042-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:380553bbaf4cb95b99183594f347721f40a33c6b43b35429ca503c833cbafbfe
3
+ size 2996331200
model-00044-of-00065.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49ad0bb532226575b60c72e988ed1799caf95be0ab7680b3f841d587455084c1
3
+ size 2997530824