Text Generation
Transformers
Safetensors
English
Chinese
glm5_next
image-text-to-text
conversational
Instructions to use unsloth/GLM-5.3-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/GLM-5.3-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/GLM-5.3-Flash") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("unsloth/GLM-5.3-Flash") model = AutoModelForMultimodalLM.from_pretrained("unsloth/GLM-5.3-Flash", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/GLM-5.3-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/GLM-5.3-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.3-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/GLM-5.3-Flash
- SGLang
How to use unsloth/GLM-5.3-Flash with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "unsloth/GLM-5.3-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.3-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "unsloth/GLM-5.3-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.3-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use unsloth/GLM-5.3-Flash with Docker Model Runner:
docker model run hf.co/unsloth/GLM-5.3-Flash
Commit ·
c68c64d
0
Parent(s):
Super-squash branch 'main' using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +36 -0
- README.md +68 -0
- chat_template.jinja +210 -0
- config.json +290 -0
- generation_config.json +12 -0
- model-00001-of-00120.safetensors +3 -0
- model-00002-of-00120.safetensors +3 -0
- model-00003-of-00120.safetensors +3 -0
- model-00004-of-00120.safetensors +3 -0
- model-00005-of-00120.safetensors +3 -0
- model-00006-of-00120.safetensors +3 -0
- model-00007-of-00120.safetensors +3 -0
- model-00008-of-00120.safetensors +3 -0
- model-00009-of-00120.safetensors +3 -0
- model-00010-of-00120.safetensors +3 -0
- model-00011-of-00120.safetensors +3 -0
- model-00012-of-00120.safetensors +3 -0
- model-00013-of-00120.safetensors +3 -0
- model-00014-of-00120.safetensors +3 -0
- model-00015-of-00120.safetensors +3 -0
- model-00016-of-00120.safetensors +3 -0
- model-00017-of-00120.safetensors +3 -0
- model-00018-of-00120.safetensors +3 -0
- model-00019-of-00120.safetensors +3 -0
- model-00020-of-00120.safetensors +3 -0
- model-00021-of-00120.safetensors +3 -0
- model-00022-of-00120.safetensors +3 -0
- model-00023-of-00120.safetensors +3 -0
- model-00024-of-00120.safetensors +3 -0
- model-00025-of-00120.safetensors +3 -0
- model-00026-of-00120.safetensors +3 -0
- model-00027-of-00120.safetensors +3 -0
- model-00028-of-00120.safetensors +3 -0
- model-00029-of-00120.safetensors +3 -0
- model-00030-of-00120.safetensors +3 -0
- model-00031-of-00120.safetensors +3 -0
- model-00032-of-00120.safetensors +3 -0
- model-00033-of-00120.safetensors +3 -0
- model-00034-of-00120.safetensors +3 -0
- model-00035-of-00120.safetensors +3 -0
- model-00036-of-00120.safetensors +3 -0
- model-00037-of-00120.safetensors +3 -0
- model-00038-of-00120.safetensors +3 -0
- model-00039-of-00120.safetensors +3 -0
- model-00040-of-00120.safetensors +3 -0
- model-00041-of-00120.safetensors +3 -0
- model-00042-of-00120.safetensors +3 -0
- model-00043-of-00120.safetensors +3 -0
- model-00044-of-00120.safetensors +3 -0
- model-00045-of-00120.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz 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,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
+
library_name: transformers
|
| 6 |
+
license: mit
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# GLM-5.3-Flash-BF16
|
| 11 |
+
|
| 12 |
+
<div align="center">
|
| 13 |
+
<img src=https://raw.githubusercontent.com/zai-org/GLM-5/refs/heads/main/resources/logo.svg width="15%"/>
|
| 14 |
+
</div>
|
| 15 |
+
<p align="center">
|
| 16 |
+
👋 Join our <a href="https://raw.githubusercontent.com/zai-org/GLM-5/refs/heads/main/resources/wechat.png" target="_blank">WeChat</a> or <a href="https://discord.gg/QR7SARHRxK" target="_blank">Discord</a> community.
|
| 17 |
+
<br>
|
| 18 |
+
📖 Check out the GLM-5.3-Flash <a href="https://z.ai/blog/glm-5.3-flash" target="_blank">blog</a> and GLM-5 <a href="https://arxiv.org/abs/2602.15763" target="_blank">Technical report</a>.
|
| 19 |
+
<br>
|
| 20 |
+
📍 Use GLM-5.3-Flash API services on <a href="https://docs.z.ai/guides/llm/glm-5.3-flash">Z.ai API Platform. </a>
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
## Introduction
|
| 24 |
+
|
| 25 |
+
We introduce GLM-5.3-Flash, the first natively multimodal model in the GLM-5 series. With 320B total parameters and just 18B active parameters, it outperforms GLM-5.2 across benchmarks and real-world workloads at one-tenth the price, while approaching Claude Opus 4.8 on coding and agentic benchmarks.
|
| 26 |
+
|
| 27 |
+
GLM-5.3-Flash starts from a newly trained base model, with its architecture and training recipe redesigned around capability and efficiency. For the first time in the GLM series, we introduce a hybrid architecture combining sparse and linear attention, sharply reducing long-context serving costs while preserving precise long-context capabilities. The model also adopts Manifold-Constrained Hyper-Connections (mHC) to further improve scaling efficiency. Together with our latest 30T-token multimodal pre-training corpus, these changes enable GLM-5.3-Flash to deliver more intelligence with less compute.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
## Serve GLM-5.3-Flash Locally
|
| 33 |
+
|
| 34 |
+
GLM-5.3-Flash supports deployment with the following frameworks. Feel free to try them out:
|
| 35 |
+
|
| 36 |
+
- [SGLang](https://github.com/sgl-project/sglang) — see [cookbook](https://cookbook.sglang.io/autoregressive/GLM/GLM-5.3-Flash)
|
| 37 |
+
- [vLLM](https://github.com/vllm-project/vllm) — see [recipes](https://recipes.vllm.ai/zai-org/GLM-5.3-Flash)
|
| 38 |
+
- [TokenSpeed](https://github.com/lightseekorg/tokenspeed) — see [here](https://lightseek.org/tokenspeed/recipes/models#glm-5-3-flash)
|
| 39 |
+
- [KTransformers](https://github.com/kvcache-ai/ktransformers) — see [tutorial](https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/kt-kernel/GLM-5.3-Flash-Tutorial.md)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
## Footnotes
|
| 43 |
+
|
| 44 |
+
* **HLE w/ tools (full set)**: We use sampling parameters of `temperature=1.0` and `top_p=0.95` for evaluation, with a maximum generation length of `163,840` tokens. The evaluation is conducted with a maximum context length of `300,000` tokens, using a context management strategy. We use GPT-5.6-luna (medium) as the judge model.
|
| 45 |
+
* **NL2Repo**: We evaluated NL2Repo with temperature=1.0, top_p=1.0, and max_new_tokens=64k under 1M context. To prevent hacking, we use rule-based and a LLM-based judgement to prevent malicious behaviors (e.g., unauthorized pip or curl operations).
|
| 46 |
+
* **DeepSWE**: We run DeepSWE using the mini-swe-agent harness with `temperature=0.95`, `top_p=1.0`, `timeout=6h` and 400K context.
|
| 47 |
+
* **Terminal-Bench 2.1**: We evaluate in Claude Code 2.1.207 with temperature=1.0, top_p=1, max_new_tokens=65536 with 6h timeout.
|
| 48 |
+
* **Agent’s Last Exam**:
|
| 49 |
+
* **Toolathlon Verified**: We obtain all results via the official evaluation service and report pass@1 averaged over 3 independent runs.
|
| 50 |
+
* **AutomationBench**: We evaluate on AutomationBench **v1.0.6**, incorporating the fix for the `null`-type handling issue introduced in [PR #13](https://github.com/zapier/AutomationBench/pull/13).
|
| 51 |
+
* **GDPval-AA v2**: Models are evaluated by Artificial Analysis.
|
| 52 |
+
* **BabyVision**: We use temperature=1.0, top_p=0.95, and a maximum context length of 164K tokens. We resize the input images such that their shorter side is at least 1.5K pixels, consistent with other baselines.
|
| 53 |
+
|
| 54 |
+
## Citation
|
| 55 |
+
|
| 56 |
+
If you find GLM-5.3-Flash useful in your research, please cite our technical report:
|
| 57 |
+
|
| 58 |
+
```bibtex
|
| 59 |
+
@misc{glm5team2026glm5vibecodingagentic,
|
| 60 |
+
title={GLM-5: from Vibe Coding to Agentic Engineering},
|
| 61 |
+
author={GLM-5-Team and : and Aohan Zeng and Xin Lv and Zhenyu Hou and Zhengxiao Du and Qinkai Zheng and Bin Chen and Da Yin and Chendi Ge and Chenghua Huang and Chengxing Xie and Chenzheng Zhu and Congfeng Yin and Cunxiang Wang and Gengzheng Pan and Hao Zeng and Haoke Zhang and Haoran Wang and Huilong Chen and Jiajie Zhang and Jian Jiao and Jiaqi Guo and Jingsen Wang and Jingzhao Du and Jinzhu Wu and Kedong Wang and Lei Li and Lin Fan and Lucen Zhong and Mingdao Liu and Mingming Zhao and Pengfan Du and Qian Dong and Rui Lu and Shuang-Li and Shulin Cao and Song Liu and Ting Jiang and Xiaodong Chen and Xiaohan Zhang and Xuancheng Huang and Xuezhen Dong and Yabo Xu and Yao Wei and Yifan An and Yilin Niu and Yitong Zhu and Yuanhao Wen and Yukuo Cen and Yushi Bai and Zhongpei Qiao and Zihan Wang and Zikang Wang and Zilin Zhu and Ziqiang Liu and Zixuan Li and Bojie Wang and Bosi Wen and Can Huang and Changpeng Cai and Chao Yu and Chen Li and Chengwei Hu and Chenhui Zhang and Dan Zhang and Daoyan Lin and Dayong Yang and Di Wang and Ding Ai and Erle Zhu and Fangzhou Yi and Feiyu Chen and Guohong Wen and Hailong Sun and Haisha Zhao and Haiyi Hu and Hanchen Zhang and Hanrui Liu and Hanyu Zhang and Hao Peng and Hao Tai and Haobo Zhang and He Liu and Hongwei Wang and Hongxi Yan and Hongyu Ge and Huan Liu and Huanpeng Chu and Jia'ni Zhao and Jiachen Wang and Jiajing Zhao and Jiamin Ren and Jiapeng Wang and Jiaxin Zhang and Jiayi Gui and Jiayue Zhao and Jijie Li and Jing An and Jing Li and Jingwei Yuan and Jinhua Du and Jinxin Liu and Junkai Zhi and Junwen Duan and Kaiyue Zhou and Kangjian Wei and Ke Wang and Keyun Luo and Laiqiang Zhang and Leigang Sha and Liang Xu and Lindong Wu and Lintao Ding and Lu Chen and Minghao Li and Nianyi Lin and Pan Ta and Qiang Zou and Rongjun Song and Ruiqi Yang and Shangqing Tu and Shangtong Yang and Shaoxiang Wu and Shengyan Zhang and Shijie Li and Shuang Li and Shuyi Fan and Wei Qin and Wei Tian and Weining Zhang and Wenbo Yu and Wenjie Liang and Xiang Kuang and Xiangmeng Cheng and Xiangyang Li and Xiaoquan Yan and Xiaowei Hu and Xiaoying Ling and Xing Fan and Xingye Xia and Xinyuan Zhang and Xinze Zhang and Xirui Pan and Xu Zou and Xunkai Zhang and Yadi Liu and Yandong Wu and Yanfu Li and Yidong Wang and Yifan Zhu and Yijun Tan and Yilin Zhou and Yiming Pan and Ying Zhang and Yinpei Su and Yipeng Geng and Yong Yan and Yonglin Tan and Yuean Bi and Yuhan Shen and Yuhao Yang and Yujiang Li and Yunan Liu and Yunqing Wang and Yuntao Li and Yurong Wu and Yutao Zhang and Yuxi Duan and Yuxuan Zhang and Zezhen Liu and Zhengtao Jiang and Zhenhe Yan and Zheyu Zhang and Zhixiang Wei and Zhuo Chen and Zhuoer Feng and Zijun Yao and Ziwei Chai and Ziyuan Wang and Zuzhou Zhang and Bin Xu and Minlie Huang and Hongning Wang and Juanzi Li and Yuxiao Dong and Jie Tang},
|
| 62 |
+
year={2026},
|
| 63 |
+
eprint={2602.15763},
|
| 64 |
+
archivePrefix={arXiv},
|
| 65 |
+
primaryClass={cs.LG},
|
| 66 |
+
url={https://arxiv.org/abs/2602.15763},
|
| 67 |
+
}
|
| 68 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
{%- if tools -%}
|
| 5 |
+
{%- macro tool_to_json(tool) -%}
|
| 6 |
+
{%- set ns_tool = namespace(first=true) -%}
|
| 7 |
+
{{ '{' -}}
|
| 8 |
+
{%- for k, v in tool.items() -%}
|
| 9 |
+
{%- if k != 'defer_loading' and k != 'strict' -%}
|
| 10 |
+
{%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}
|
| 11 |
+
{%- set ns_tool.first = false -%}
|
| 12 |
+
"{{ k }}": {{ v | tojson(ensure_ascii=False) }}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- endfor -%}
|
| 15 |
+
{{- '}' -}}
|
| 16 |
+
{%- endmacro -%}
|
| 17 |
+
{%- macro tool_references_to_response(refs) -%}
|
| 18 |
+
{{- '<tool_response><tools>\n' -}}
|
| 19 |
+
{%- for tr in refs -%}
|
| 20 |
+
{%- for tool in tools -%}
|
| 21 |
+
{%- if 'function' in tool -%}
|
| 22 |
+
{%- set tool = tool['function'] -%}
|
| 23 |
+
{%- endif -%}
|
| 24 |
+
{%- if tool.name == tr.name -%}
|
| 25 |
+
{{- tool_to_json(tool) + '\n' -}}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{%- endfor -%}
|
| 29 |
+
{{- '</tools></tool_response>' -}}
|
| 30 |
+
{%- endmacro -%}
|
| 31 |
+
<|system|>
|
| 32 |
+
# Tools
|
| 33 |
+
|
| 34 |
+
You may call one or more functions to assist with the user query.
|
| 35 |
+
|
| 36 |
+
You are provided with function signatures within <tools></tools> XML tags:
|
| 37 |
+
<tools>
|
| 38 |
+
{% for tool in tools %}
|
| 39 |
+
{%- if 'function' in tool -%}
|
| 40 |
+
{%- set tool = tool['function'] -%}
|
| 41 |
+
{%- endif -%}
|
| 42 |
+
{% if tool.defer_loading is not defined or not tool.defer_loading %}
|
| 43 |
+
{{ tool_to_json(tool) }}
|
| 44 |
+
{% endif %}
|
| 45 |
+
{% endfor %}
|
| 46 |
+
</tools>
|
| 47 |
+
|
| 48 |
+
For each function call, output the function name and arguments within the following XML format:
|
| 49 |
+
<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 -%}
|
| 50 |
+
{%- macro visible_text(content) -%}
|
| 51 |
+
{%- if content is string -%}
|
| 52 |
+
{{- content }}
|
| 53 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 54 |
+
{%- for item in content -%}
|
| 55 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 56 |
+
{{- item.text }}
|
| 57 |
+
{%- elif item is string -%}
|
| 58 |
+
{{- item }}
|
| 59 |
+
{%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%}
|
| 60 |
+
{%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%}
|
| 61 |
+
{{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
{%- endfor -%}
|
| 64 |
+
{%- else -%}
|
| 65 |
+
{{- content }}
|
| 66 |
+
{%- endif -%}
|
| 67 |
+
{%- endmacro -%}
|
| 68 |
+
{%- macro tool_response(text) -%}
|
| 69 |
+
{{- '<tool_response>' + text + '</tool_response>' -}}
|
| 70 |
+
{%- endmacro -%}
|
| 71 |
+
{%- macro render_tool_response(m) -%}
|
| 72 |
+
{%- if m.content is string -%}
|
| 73 |
+
{{- tool_response(m.content) -}}
|
| 74 |
+
{%- elif m.content and m.content is not mapping and m.content.0.type == "tool_reference" -%}
|
| 75 |
+
{{- tool_references_to_response(m.content) -}}
|
| 76 |
+
{%- elif is_list_of_outputs(m) -%}
|
| 77 |
+
{%- for tr in m.content -%}
|
| 78 |
+
{%- 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" -%}
|
| 79 |
+
{{- tool_references_to_response(tr.output) -}}
|
| 80 |
+
{%- else -%}
|
| 81 |
+
{{- tool_response(visible_text(tr.output)) -}}
|
| 82 |
+
{%- endif -%}
|
| 83 |
+
{%- endfor -%}
|
| 84 |
+
{%- else -%}
|
| 85 |
+
{{- tool_response(visible_text(m.content)) -}}
|
| 86 |
+
{%- endif -%}
|
| 87 |
+
{%- endmacro -%}
|
| 88 |
+
{%- macro id_of(obj) -%}
|
| 89 |
+
{%- if obj.tool_call_id -%}
|
| 90 |
+
{{- obj.tool_call_id -}}
|
| 91 |
+
{%- elif obj.id -%}
|
| 92 |
+
{{- obj.id -}}
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- endmacro -%}
|
| 95 |
+
{%- macro is_list_of_outputs(m) -%}
|
| 96 |
+
{%- if m.content and m.content.0.output is defined -%}1{%- endif -%}
|
| 97 |
+
{%- endmacro -%}
|
| 98 |
+
{%- set ns = namespace(last_user_index=-1) -%}
|
| 99 |
+
{%- for m in messages %}
|
| 100 |
+
{%- if m.role == 'user' %}
|
| 101 |
+
{%- set ns.last_user_index = loop.index0 -%}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{%- endfor %}
|
| 104 |
+
{%- for m in messages -%}
|
| 105 |
+
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
|
| 106 |
+
{%- elif m.role == 'assistant' -%}
|
| 107 |
+
<|assistant|>
|
| 108 |
+
{%- set content = visible_text(m.content) %}
|
| 109 |
+
{%- if m.reasoning_content is string %}
|
| 110 |
+
{%- set reasoning_content = m.reasoning_content %}
|
| 111 |
+
{%- elif '</think>' in content %}
|
| 112 |
+
{%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}
|
| 113 |
+
{%- set content = content.split('</think>')[-1] %}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}
|
| 116 |
+
{{ '<think>' + reasoning_content + '</think>'}}
|
| 117 |
+
{%- else -%}
|
| 118 |
+
{{ '<think></think>' }}
|
| 119 |
+
{%- endif -%}
|
| 120 |
+
{%- if content.strip() -%}
|
| 121 |
+
{{ content.strip() }}
|
| 122 |
+
{%- endif -%}
|
| 123 |
+
{% if m.tool_calls %}
|
| 124 |
+
{% for tc in m.tool_calls %}
|
| 125 |
+
{%- if tc.function %}
|
| 126 |
+
{%- set tc = tc.function %}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '<tool_call>' + tc.name -}}
|
| 129 |
+
{% 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 %}
|
| 130 |
+
{% endif %}
|
| 131 |
+
{%- elif m.role == 'tool' -%}
|
| 132 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 133 |
+
{{- '<|observation|>' -}}
|
| 134 |
+
{%- set block_start = loop.index0 -%}
|
| 135 |
+
{%- set ns_blk = namespace(end=block_start) -%}
|
| 136 |
+
{%- for j in range(block_start, messages|length) -%}
|
| 137 |
+
{%- if messages[j].role == 'tool' -%}
|
| 138 |
+
{%- set ns_blk.end = j -%}
|
| 139 |
+
{%- else -%}
|
| 140 |
+
{%- break -%}
|
| 141 |
+
{%- endif -%}
|
| 142 |
+
{%- endfor -%}
|
| 143 |
+
{%- set ns_a = namespace(tool_calls=none) -%}
|
| 144 |
+
{%- if block_start > 0 and messages[block_start - 1].role == 'assistant' and messages[block_start - 1].tool_calls -%}
|
| 145 |
+
{%- set ns_a.tool_calls = messages[block_start - 1].tool_calls -%}
|
| 146 |
+
{%- endif -%}
|
| 147 |
+
{%- set ns_chk = namespace(can_sort=true) -%}
|
| 148 |
+
{%- if not ns_a.tool_calls -%}
|
| 149 |
+
{%- set ns_chk.can_sort = false -%}
|
| 150 |
+
{%- else -%}
|
| 151 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 152 |
+
{%- set m = messages[k] -%}
|
| 153 |
+
{%- if is_list_of_outputs(m) -%}
|
| 154 |
+
{%- for entry in m.content -%}
|
| 155 |
+
{%- set eid = id_of(entry) -%}
|
| 156 |
+
{%- if not eid -%}
|
| 157 |
+
{%- set ns_chk.can_sort = false -%}
|
| 158 |
+
{%- endif -%}
|
| 159 |
+
{%- endfor -%}
|
| 160 |
+
{%- else -%}
|
| 161 |
+
{%- set tk_id = id_of(m) -%}
|
| 162 |
+
{%- if not tk_id -%}
|
| 163 |
+
{%- set ns_chk.can_sort = false -%}
|
| 164 |
+
{%- endif -%}
|
| 165 |
+
{%- endif -%}
|
| 166 |
+
{%- endfor -%}
|
| 167 |
+
{%- for tc in ns_a.tool_calls -%}
|
| 168 |
+
{%- set tc_id = id_of(tc) -%}
|
| 169 |
+
{%- if not tc_id -%}
|
| 170 |
+
{%- set ns_chk.can_sort = false -%}
|
| 171 |
+
{%- endif -%}
|
| 172 |
+
{%- endfor -%}
|
| 173 |
+
{%- endif -%}
|
| 174 |
+
{%- if ns_chk.can_sort -%}
|
| 175 |
+
{%- for tc in ns_a.tool_calls -%}
|
| 176 |
+
{%- set tc_id = id_of(tc) -%}
|
| 177 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 178 |
+
{%- set m = messages[k] -%}
|
| 179 |
+
{%- if is_list_of_outputs(m) -%}
|
| 180 |
+
{%- for entry in m.content -%}
|
| 181 |
+
{%- set eid = id_of(entry) -%}
|
| 182 |
+
{%- if eid == tc_id -%}
|
| 183 |
+
{%- 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" -%}
|
| 184 |
+
{{- tool_references_to_response(entry.output) -}}
|
| 185 |
+
{%- else -%}
|
| 186 |
+
{{- tool_response(visible_text(entry.output)) -}}
|
| 187 |
+
{%- endif -%}
|
| 188 |
+
{%- endif -%}
|
| 189 |
+
{%- endfor -%}
|
| 190 |
+
{%- else -%}
|
| 191 |
+
{%- set tk_id = id_of(m) -%}
|
| 192 |
+
{%- if tk_id == tc_id -%}
|
| 193 |
+
{{- render_tool_response(m) -}}
|
| 194 |
+
{%- endif -%}
|
| 195 |
+
{%- endif -%}
|
| 196 |
+
{%- endfor -%}
|
| 197 |
+
{%- endfor -%}
|
| 198 |
+
{%- else -%}
|
| 199 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 200 |
+
{{- render_tool_response(messages[k]) -}}
|
| 201 |
+
{%- endfor -%}
|
| 202 |
+
{%- endif -%}
|
| 203 |
+
{% endif -%}
|
| 204 |
+
{%- elif m.role == 'system' -%}
|
| 205 |
+
<|system|>{{ visible_text(m.content) }}
|
| 206 |
+
{%- endif -%}
|
| 207 |
+
{%- endfor -%}
|
| 208 |
+
{%- if add_generation_prompt -%}
|
| 209 |
+
<|assistant|>{{- '<think>' -}}
|
| 210 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Glm5NextForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"text_config": {
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": [
|
| 10 |
+
154820,
|
| 11 |
+
154827,
|
| 12 |
+
154829
|
| 13 |
+
],
|
| 14 |
+
"first_k_dense_replace": 3,
|
| 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": 4096,
|
| 21 |
+
"index_head_dim": 128,
|
| 22 |
+
"index_kpool": 4,
|
| 23 |
+
"index_kpool_always_select_tail": true,
|
| 24 |
+
"index_kpool_compress": true,
|
| 25 |
+
"index_n_heads": 32,
|
| 26 |
+
"index_topk": 2048,
|
| 27 |
+
"index_share_for_mtp_iteration": true,
|
| 28 |
+
"indexer_rope_interleave": true,
|
| 29 |
+
"indexer_types": [
|
| 30 |
+
"full",
|
| 31 |
+
"full",
|
| 32 |
+
"full",
|
| 33 |
+
"full",
|
| 34 |
+
"full",
|
| 35 |
+
"full",
|
| 36 |
+
"full",
|
| 37 |
+
"full",
|
| 38 |
+
"full",
|
| 39 |
+
"full",
|
| 40 |
+
"full",
|
| 41 |
+
"full",
|
| 42 |
+
"full",
|
| 43 |
+
"full",
|
| 44 |
+
"full",
|
| 45 |
+
"full",
|
| 46 |
+
"full",
|
| 47 |
+
"full",
|
| 48 |
+
"full",
|
| 49 |
+
"full",
|
| 50 |
+
"full",
|
| 51 |
+
"full",
|
| 52 |
+
"full",
|
| 53 |
+
"full",
|
| 54 |
+
"full",
|
| 55 |
+
"full",
|
| 56 |
+
"full",
|
| 57 |
+
"full",
|
| 58 |
+
"full",
|
| 59 |
+
"full",
|
| 60 |
+
"full",
|
| 61 |
+
"full",
|
| 62 |
+
"full",
|
| 63 |
+
"full",
|
| 64 |
+
"full",
|
| 65 |
+
"full",
|
| 66 |
+
"full",
|
| 67 |
+
"full",
|
| 68 |
+
"full",
|
| 69 |
+
"full",
|
| 70 |
+
"full",
|
| 71 |
+
"full",
|
| 72 |
+
"full",
|
| 73 |
+
"full",
|
| 74 |
+
"full"
|
| 75 |
+
],
|
| 76 |
+
"initializer_range": 0.02,
|
| 77 |
+
"intermediate_size": 12288,
|
| 78 |
+
"kv_lora_rank": 512,
|
| 79 |
+
"layer_types": [
|
| 80 |
+
"linear_attention",
|
| 81 |
+
"linear_attention",
|
| 82 |
+
"linear_attention",
|
| 83 |
+
"deepseek_sparse_attention",
|
| 84 |
+
"linear_attention",
|
| 85 |
+
"linear_attention",
|
| 86 |
+
"linear_attention",
|
| 87 |
+
"deepseek_sparse_attention",
|
| 88 |
+
"linear_attention",
|
| 89 |
+
"linear_attention",
|
| 90 |
+
"linear_attention",
|
| 91 |
+
"deepseek_sparse_attention",
|
| 92 |
+
"linear_attention",
|
| 93 |
+
"linear_attention",
|
| 94 |
+
"linear_attention",
|
| 95 |
+
"deepseek_sparse_attention",
|
| 96 |
+
"linear_attention",
|
| 97 |
+
"linear_attention",
|
| 98 |
+
"linear_attention",
|
| 99 |
+
"deepseek_sparse_attention",
|
| 100 |
+
"linear_attention",
|
| 101 |
+
"linear_attention",
|
| 102 |
+
"linear_attention",
|
| 103 |
+
"deepseek_sparse_attention",
|
| 104 |
+
"linear_attention",
|
| 105 |
+
"linear_attention",
|
| 106 |
+
"linear_attention",
|
| 107 |
+
"deepseek_sparse_attention",
|
| 108 |
+
"linear_attention",
|
| 109 |
+
"linear_attention",
|
| 110 |
+
"linear_attention",
|
| 111 |
+
"deepseek_sparse_attention",
|
| 112 |
+
"linear_attention",
|
| 113 |
+
"linear_attention",
|
| 114 |
+
"linear_attention",
|
| 115 |
+
"deepseek_sparse_attention",
|
| 116 |
+
"linear_attention",
|
| 117 |
+
"linear_attention",
|
| 118 |
+
"linear_attention",
|
| 119 |
+
"deepseek_sparse_attention",
|
| 120 |
+
"linear_attention",
|
| 121 |
+
"linear_attention",
|
| 122 |
+
"linear_attention",
|
| 123 |
+
"deepseek_sparse_attention",
|
| 124 |
+
"linear_attention"
|
| 125 |
+
],
|
| 126 |
+
"linear_attn_config": {
|
| 127 |
+
"num_heads": 64,
|
| 128 |
+
"gate_lower_bound": -5.0,
|
| 129 |
+
"head_dim": 128,
|
| 130 |
+
"short_conv_kernel_size": 4,
|
| 131 |
+
"kda_layers": [
|
| 132 |
+
0,
|
| 133 |
+
1,
|
| 134 |
+
2,
|
| 135 |
+
4,
|
| 136 |
+
5,
|
| 137 |
+
6,
|
| 138 |
+
8,
|
| 139 |
+
9,
|
| 140 |
+
10,
|
| 141 |
+
12,
|
| 142 |
+
13,
|
| 143 |
+
14,
|
| 144 |
+
16,
|
| 145 |
+
17,
|
| 146 |
+
18,
|
| 147 |
+
20,
|
| 148 |
+
21,
|
| 149 |
+
22,
|
| 150 |
+
24,
|
| 151 |
+
25,
|
| 152 |
+
26,
|
| 153 |
+
28,
|
| 154 |
+
29,
|
| 155 |
+
30,
|
| 156 |
+
32,
|
| 157 |
+
33,
|
| 158 |
+
34,
|
| 159 |
+
36,
|
| 160 |
+
37,
|
| 161 |
+
38,
|
| 162 |
+
40,
|
| 163 |
+
41,
|
| 164 |
+
42,
|
| 165 |
+
44
|
| 166 |
+
],
|
| 167 |
+
"full_attn_layers": [
|
| 168 |
+
3,
|
| 169 |
+
7,
|
| 170 |
+
11,
|
| 171 |
+
15,
|
| 172 |
+
19,
|
| 173 |
+
23,
|
| 174 |
+
27,
|
| 175 |
+
31,
|
| 176 |
+
35,
|
| 177 |
+
39,
|
| 178 |
+
43
|
| 179 |
+
]
|
| 180 |
+
},
|
| 181 |
+
"max_position_embeddings": 1048576,
|
| 182 |
+
"mhc": true,
|
| 183 |
+
"mla_use_nope": true,
|
| 184 |
+
"mlp_layer_types": [
|
| 185 |
+
"dense",
|
| 186 |
+
"dense",
|
| 187 |
+
"dense",
|
| 188 |
+
"sparse",
|
| 189 |
+
"sparse",
|
| 190 |
+
"sparse",
|
| 191 |
+
"sparse",
|
| 192 |
+
"sparse",
|
| 193 |
+
"sparse",
|
| 194 |
+
"sparse",
|
| 195 |
+
"sparse",
|
| 196 |
+
"sparse",
|
| 197 |
+
"sparse",
|
| 198 |
+
"sparse",
|
| 199 |
+
"sparse",
|
| 200 |
+
"sparse",
|
| 201 |
+
"sparse",
|
| 202 |
+
"sparse",
|
| 203 |
+
"sparse",
|
| 204 |
+
"sparse",
|
| 205 |
+
"sparse",
|
| 206 |
+
"sparse",
|
| 207 |
+
"sparse",
|
| 208 |
+
"sparse",
|
| 209 |
+
"sparse",
|
| 210 |
+
"sparse",
|
| 211 |
+
"sparse",
|
| 212 |
+
"sparse",
|
| 213 |
+
"sparse",
|
| 214 |
+
"sparse",
|
| 215 |
+
"sparse",
|
| 216 |
+
"sparse",
|
| 217 |
+
"sparse",
|
| 218 |
+
"sparse",
|
| 219 |
+
"sparse",
|
| 220 |
+
"sparse",
|
| 221 |
+
"sparse",
|
| 222 |
+
"sparse",
|
| 223 |
+
"sparse",
|
| 224 |
+
"sparse",
|
| 225 |
+
"sparse",
|
| 226 |
+
"sparse",
|
| 227 |
+
"sparse",
|
| 228 |
+
"sparse",
|
| 229 |
+
"sparse"
|
| 230 |
+
],
|
| 231 |
+
"model_type": "glm5_next_text",
|
| 232 |
+
"moe_intermediate_size": 2048,
|
| 233 |
+
"moe_router_dtype": "float32",
|
| 234 |
+
"n_group": 1,
|
| 235 |
+
"n_routed_experts": 288,
|
| 236 |
+
"n_shared_experts": 1,
|
| 237 |
+
"norm_topk_prob": true,
|
| 238 |
+
"num_attention_heads": 64,
|
| 239 |
+
"num_experts_per_tok": 8,
|
| 240 |
+
"num_hidden_layers": 45,
|
| 241 |
+
"num_key_value_heads": 64,
|
| 242 |
+
"num_nextn_predict_layers": 1,
|
| 243 |
+
"output_router_logits": false,
|
| 244 |
+
"pad_token_id": 154820,
|
| 245 |
+
"q_lora_rank": 1536,
|
| 246 |
+
"qk_head_dim": 256,
|
| 247 |
+
"qk_nope_head_dim": 256,
|
| 248 |
+
"qk_rope_head_dim": 0,
|
| 249 |
+
"rms_norm_eps": 1e-05,
|
| 250 |
+
"routed_scaling_factor": 2.5,
|
| 251 |
+
"router_aux_loss_coef": 0.001,
|
| 252 |
+
"scoring_func": "sigmoid",
|
| 253 |
+
"swiglu_limit": 10.0,
|
| 254 |
+
"tie_word_embeddings": false,
|
| 255 |
+
"topk_group": 1,
|
| 256 |
+
"topk_method": "noaux_tc",
|
| 257 |
+
"use_cache": true,
|
| 258 |
+
"v_head_dim": 256,
|
| 259 |
+
"vocab_size": 154880
|
| 260 |
+
},
|
| 261 |
+
"vision_config": {
|
| 262 |
+
"attention_bias": true,
|
| 263 |
+
"attention_dropout": 0.0,
|
| 264 |
+
"depth": 24,
|
| 265 |
+
"hidden_act": "silu",
|
| 266 |
+
"hidden_size": 1024,
|
| 267 |
+
"image_size": 448,
|
| 268 |
+
"in_channels": 3,
|
| 269 |
+
"initializer_range": 0.02,
|
| 270 |
+
"intermediate_size": 4096,
|
| 271 |
+
"model_type": "glm5_next_vision",
|
| 272 |
+
"num_heads": 16,
|
| 273 |
+
"out_hidden_size": 4096,
|
| 274 |
+
"patch_size": 14,
|
| 275 |
+
"projection_intermediate_size": 10240,
|
| 276 |
+
"rms_norm_eps": 1e-05,
|
| 277 |
+
"spatial_merge_size": 2,
|
| 278 |
+
"swiglu_limit": 10.0,
|
| 279 |
+
"temporal_patch_size": 2
|
| 280 |
+
},
|
| 281 |
+
"image_token_id": 154854,
|
| 282 |
+
"video_token_id": 154855,
|
| 283 |
+
"image_start_token_id": 154830,
|
| 284 |
+
"image_end_token_id": 154831,
|
| 285 |
+
"video_start_token_id": 154832,
|
| 286 |
+
"video_end_token_id": 154833,
|
| 287 |
+
"tie_word_embeddings": false,
|
| 288 |
+
"model_type": "glm5_next",
|
| 289 |
+
"transformers_version": "5.16.0"
|
| 290 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"top_p": 0.95,
|
| 11 |
+
"transformers_version": "5.16.0"
|
| 12 |
+
}
|
model-00001-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:235676346453d461485e6be4677d03efe7bc72fc6e2f63e82e8c289e89bdbbbc
|
| 3 |
+
size 5358221856
|
model-00002-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9a579db4b6673a12b42d1eea6c716b07cacd05eb9dc2055deb4a6b36a5c9547
|
| 3 |
+
size 5368754184
|
model-00003-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1c074e78f6839dbf8d5fa976ca7e818fb94c74f45017ca73ce045ca45d59298
|
| 3 |
+
size 5368754080
|
model-00004-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f779f22bdcd4d615bcf9571133f35d5a8698d99fcb54ff11ded19c4602fb97d3
|
| 3 |
+
size 5362973096
|
model-00005-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c443797cfbdc692b97f6af60e5bad8a71945b902db462b600afa0d373ccebf8a
|
| 3 |
+
size 5368754192
|
model-00006-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e19c52baa443dccf8ec49204d0f39e3cc54d9ad25487b6249974182c701b6787
|
| 3 |
+
size 5368754008
|
model-00007-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1cd7cf3a62ef1fc251593738f49811bc0f8973e24b58d7ad0ef4a5ec7f0e057
|
| 3 |
+
size 5354098288
|
model-00008-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c5be585f6548ea3188b4aa2af4578fa49c4be30f488909b104fac8c5afa16e25
|
| 3 |
+
size 5368754192
|
model-00009-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20e1607acb84ff3f0f1f718c6c658f6104afd7725258b53318a2c8fde36bcff8
|
| 3 |
+
size 5362972992
|
model-00010-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4eedc71726f60260d4cf4542013a0c387e275552021595e3b37312f9f263884b
|
| 3 |
+
size 5368754192
|
model-00011-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec169413131fa43e8e8edb5e2933a0f4151c71ddda8d740ed0ef338638b9476d
|
| 3 |
+
size 5368754168
|
model-00012-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d87a818732bb1d148627e2859bea7032922f56cc9fded4d7a7adef972e56ad7
|
| 3 |
+
size 5362973008
|
model-00013-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98ab21dfd26d9f7eec1e5a191ff5530c4fc0f30be73964cdb5d873fcd5dd33df
|
| 3 |
+
size 5368754192
|
model-00014-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3fbc86a57595a572acbea7e68679a36996c3787f65af0ca1ec0dbf354a54478
|
| 3 |
+
size 5368754096
|
model-00015-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0675c7c17dba8294f699163b7b8a1d36583532428312df2158353567cdeaf63
|
| 3 |
+
size 5362973080
|
model-00016-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac6e1f3995bd35f0cf84d81127c3b47a08755ec440d271872aae71eac239b1ce
|
| 3 |
+
size 5368754184
|
model-00017-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54fd5dc4368c77a58ae398a6981936ab22c14e3653401ca71c69a60df3b4b316
|
| 3 |
+
size 5368754024
|
model-00018-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96914257eda1ff08d39bf8bbe361846d6affc640a8aa70f8b95ba41f69de154c
|
| 3 |
+
size 5354098280
|
model-00019-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1d0ce28fd876355ca2bc79dd503ce77d6ae4594d8211695dc953fe9c219b48f
|
| 3 |
+
size 5368754184
|
model-00020-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c92e988143d426cc42ab8f956808851fe2662be2c6c9dc6705278a093f010559
|
| 3 |
+
size 5344548784
|
model-00021-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:770e6e5ff64be12df60f0db52fc2468f329cef29e1ffa24ab51ceedf93458053
|
| 3 |
+
size 5353623672
|
model-00022-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d4eae929329f0b114dc9a7271dbe3584572abc26c62c185944e4da29faff41fe
|
| 3 |
+
size 5368754184
|
model-00023-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a1cc24e1f054ccfa871cb3f77ee45c33a7b16b939eb9102a09244489c58e6e1
|
| 3 |
+
size 5362972992
|
model-00024-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38445ed5d28886018629c414e08de37c160b27bd92eb572065cbfaf1318061cb
|
| 3 |
+
size 5368754184
|
model-00025-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69d1f2d1d57fe3176bfe1140e61db929c1f433ec402d896260fc19b2bd63a095
|
| 3 |
+
size 5368754120
|
model-00026-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6edab6ba31fe288596296d03616de97b3a5049816ed9e87028818f956872b1b
|
| 3 |
+
size 5362973064
|
model-00027-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c2279cbac07ee1150c581fd38b00cf823798066e0fb5cbccc6608df7406065c
|
| 3 |
+
size 5368754192
|
model-00028-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:126c58a26adb9305d16bbab3e422eeb9520f0929886362a558c7942976a161a1
|
| 3 |
+
size 5368754040
|
model-00029-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56ef332e7e31bc0c0412c442a343d57e6a9db52679235712f040f5e8209a4845
|
| 3 |
+
size 5362731784
|
model-00030-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf27db4a2ec987f8e40ce13de72b376efd96ae54391faf87e26a81b64f8ee09f
|
| 3 |
+
size 5368754192
|
model-00031-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bca28a2651d2ff2fc0e91f67ac278b8191e8409d58d5a6d91edc4aba7c8828bc
|
| 3 |
+
size 5368754000
|
model-00032-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3ec76e3d414a0ec309c2ae01636aac466476052b98e46024d92c4cac30e1db0
|
| 3 |
+
size 5362973184
|
model-00033-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4077e01010598f2f435064ad2f01351ac4fa2a75f98154ee05796edab48d36a
|
| 3 |
+
size 5368754184
|
model-00034-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:403b364c1f11a5dbbed0c7f11ba47720fe2b0c8b431ccd0d9769c8fd6ffcab90
|
| 3 |
+
size 5362972992
|
model-00035-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81539b0fddb1ecce4ae6b2af80489b3788c812a47e3d7ef128e811f9aed12ae5
|
| 3 |
+
size 5368754192
|
model-00036-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53bae35fd29f396066e4fd0c84ce05bd81d243e6de06c00f7ea79793f7bdf3aa
|
| 3 |
+
size 5368754160
|
model-00037-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad04a34fa52e3862324c242c7475c7d1ae04e8d42c286d7d132b67b59d72da27
|
| 3 |
+
size 5362973016
|
model-00038-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5719298b0c75ec1781644d0f5e84d769676663abd75639eb6516fe4776b6a411
|
| 3 |
+
size 5368754184
|
model-00039-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a511ae0fb183da66bf6e63d39cddb5aeefd64bbae3652cde2f528439429ba6c6
|
| 3 |
+
size 5368754088
|
model-00040-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:710f6a7eb5675ecd64965b11b01b11c302e717611c09f82524f5e5e333d2d18e
|
| 3 |
+
size 5354098216
|
model-00041-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:581b8b772565134d57d8b9166403a31c0466fb68a7a2ce43bf67306e9850884e
|
| 3 |
+
size 5368754184
|
model-00042-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8248acd87af1ef78341c480e73e600e93586010d35bfc0c1e8ccb8c0f5a58fc
|
| 3 |
+
size 5368754008
|
model-00043-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:66a0a4e0c9294e74569583c76114ad9894cb02b3146fbd56a5e9a0b95a427e2a
|
| 3 |
+
size 5362973160
|
model-00044-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28cc935cd8fdc66623fead64d5f9b89e9313bb2c9f16854b74a456a726bd757c
|
| 3 |
+
size 5368754192
|
model-00045-of-00120.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce42ab000da9803f80ea50641bf19a0efaa76e184bfc0b94437754122ef08799
|
| 3 |
+
size 5362972992
|