trohrbaugh commited on
Commit
4fddc24
·
verified ·
1 Parent(s): b216594

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +167 -164
README.md CHANGED
@@ -1,199 +1,202 @@
1
  ---
 
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
4
  ---
 
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
 
 
 
 
 
 
 
 
 
 
9
 
 
10
 
 
 
 
 
11
 
12
- ## Model Details
13
 
14
- ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
 
 
 
 
 
 
39
 
40
- ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
 
44
- [More Information Needed]
45
 
46
- ### Downstream Use [optional]
 
 
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
- [More Information Needed]
51
 
52
- ### Out-of-Scope Use
 
 
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
- [More Information Needed]
 
57
 
58
- ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- ### Recommendations
 
 
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
 
 
69
 
70
- ## How to Get Started with the Model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- Use the code below to get started with the model.
73
 
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
+ language:
3
+ - en
4
+ - zh
5
  library_name: transformers
6
+ license: mit
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - heretic
10
+ - uncensored
11
+ - decensored
12
+ - abliterated
13
  ---
14
+ # This is a decensored version of [zai-org/GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash), made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0
15
 
16
+ ## Abliteration parameters
17
 
18
+ | Parameter | Value |
19
+ | :-------- | :---: |
20
+ | **direction_index** | 27.08 |
21
+ | **attn.o_proj.max_weight** | 2.00 |
22
+ | **attn.o_proj.max_weight_position** | 35.19 |
23
+ | **attn.o_proj.min_weight** | 0.84 |
24
+ | **attn.o_proj.min_weight_distance** | 22.73 |
25
+ | **mlp.down_proj.max_weight** | 1.04 |
26
+ | **mlp.down_proj.max_weight_position** | 33.72 |
27
+ | **mlp.down_proj.min_weight** | 1.01 |
28
+ | **mlp.down_proj.min_weight_distance** | 15.17 |
29
 
30
+ ## Performance
31
 
32
+ | Metric | This model | Original model ([zai-org/GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash)) |
33
+ | :----- | :--------: | :---------------------------: |
34
+ | **KL divergence** | 0.0393 | 0 *(by definition)* |
35
+ | **Refusals** | 4/100 | 99/100 |
36
 
37
+ -----
38
 
 
39
 
40
+ # GLM-4.7-Flash
41
 
42
+ <div align="center">
43
+ <img src=https://raw.githubusercontent.com/zai-org/GLM-4.5/refs/heads/main/resources/logo.svg width="15%"/>
44
+ </div>
45
+ <p align="center">
46
+ 👋 Join our <a href="https://discord.gg/QR7SARHRxK" target="_blank">Discord</a> community.
47
+ <br>
48
+ 📖 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>.
49
+ <br>
50
+ 📍 Use GLM-4.7-Flash API services on <a href="https://docs.z.ai/guides/llm/glm-4.7">Z.ai API Platform. </a>
51
+ <br>
52
+ 👉 One click to <a href="https://chat.z.ai">GLM-4.7</a>.
53
+ </p>
54
 
55
+ ## Introduction
 
 
 
 
 
 
56
 
57
+ GLM-4.7-Flash is a 30B-A3B MoE model. As the strongest model in the 30B class, GLM-4.7-Flash offers a new option for lightweight deployment that balances performance and efficiency.
58
 
 
59
 
60
+ ### Performances on Benchmarks
 
 
61
 
 
62
 
63
+ | Benchmark | GLM-4.7-Flash | Qwen3-30B-A3B-Thinking-2507 | GPT-OSS-20B |
64
+ |--------------------|---------------|-----------------------------|-------------|
65
+ | AIME 25 | 91.6 | 85.0 | 91.7 |
66
+ | GPQA | 75.2 | 73.4 | 71.5 |
67
+ | LCB v6 | 64.0 | 66.0 | 61.0 |
68
+ | HLE | 14.4 | 9.8 | 10.9 |
69
+ | SWE-bench Verified | 59.2 | 22.0 | 34.0 |
70
+ | τ²-Bench | 79.5 | 49.0 | 47.7 |
71
+ | BrowseComp | 42.8 | 2.29 | 28.3 |
72
 
 
73
 
74
+ ### Evaluation Parameters
75
 
76
+ **Default Settings (Most Tasks)**
77
 
78
+ * temperature: `1.0`
79
+ * top-p: `0.95`
80
+ * max new tokens: `131072`
81
 
82
+ For multi-turn agentic tasks (τ²-Bench and Terminal Bench 2), please turn on [Preserved Thinking mode](https://docs.z.ai/guides/capabilities/thinking-mode).
83
 
84
+ **Terminal Bench, SWE Bench Verified**
85
 
86
+ * temperature: `0.7`
87
+ * top-p: `1.0`
88
+ * max new tokens: `16384`
89
 
90
+ **τ^2-Bench**
91
 
92
+ * Temperature: `0`
93
+ * Max new tokens: `16384`
94
 
95
+ 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.
96
 
97
+ ## Serve GLM-4.7-Flash Locally
98
 
99
+ For local deployment, GLM-4.7-Flash supports inference frameworks including vLLM and SGLang. Comprehensive deployment
100
+ instructions are available in the official [Github](https://github.com/zai-org/GLM-4.5) repository.
101
+
102
+ vLLM and SGLang only support GLM-4.7-Flash on their main branches.
103
+
104
+ ### vLLM
105
+
106
+ + using pip (must use pypi.org as the index url):
107
+
108
+ ```shell
109
+ pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
110
+ pip install git+https://github.com/huggingface/transformers.git
111
+ ```
112
+
113
+ ### SGLang
114
+
115
+ + Install the supported versions of SGLang and Transformers (using `uv` is recommended):
116
+
117
+ ```shell
118
+ uv pip install sglang==0.3.2.dev9039+pr-17247.g90c446848 --extra-index-url https://sgl-project.github.io/whl/pr/
119
+ uv pip install git+https://github.com/huggingface/transformers.git@76732b4e7120808ff989edbd16401f61fa6a0afa
120
+ ```
121
+
122
+ ### transformers
123
+
124
+ using with transformers as
125
 
126
+ ```shell
127
+ pip install git+https://github.com/huggingface/transformers.git
128
+ ```
129
 
130
+ and then run:
131
 
132
+ ```python
133
+ import torch
134
+ from transformers import AutoModelForCausalLM, AutoTokenizer
135
 
136
+ MODEL_PATH = "zai-org/GLM-4.7-Flash"
137
+ messages = [{"role": "user", "content": "hello"}]
138
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
139
+ inputs = tokenizer.apply_chat_template(
140
+ messages,
141
+ tokenize=True,
142
+ add_generation_prompt=True,
143
+ return_dict=True,
144
+ return_tensors="pt",
145
+ )
146
+ model = AutoModelForCausalLM.from_pretrained(
147
+ pretrained_model_name_or_path=MODEL_PATH,
148
+ torch_dtype=torch.bfloat16,
149
+ device_map="auto",
150
+ )
151
+ inputs = inputs.to(model.device)
152
+ generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
153
+ output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1]:])
154
+ print(output_text)
155
+ ```
156
 
157
+ ### vLLM
158
 
159
+ ```shell
160
+ vllm serve zai-org/GLM-4.7-Flash \
161
+ --tensor-parallel-size 4 \
162
+ --speculative-config.method mtp \
163
+ --speculative-config.num_speculative_tokens 1 \
164
+ --tool-call-parser glm47 \
165
+ --reasoning-parser glm45 \
166
+ --enable-auto-tool-choice \
167
+ --served-model-name glm-4.7-flash
168
+ ```
169
+
170
+ ### SGLang
171
+
172
+ ```shell
173
+ python3 -m sglang.launch_server \
174
+ --model-path zai-org/GLM-4.7-Flash \
175
+ --tp-size 4 \
176
+ --tool-call-parser glm47 \
177
+ --reasoning-parser glm45 \
178
+ --speculative-algorithm EAGLE \
179
+ --speculative-num-steps 3 \
180
+ --speculative-eagle-topk 1 \
181
+ --speculative-num-draft-tokens 4 \
182
+ --mem-fraction-static 0.8 \
183
+ --served-model-name glm-4.7-flash \
184
+ --host 0.0.0.0 \
185
+ --port 8000
186
+ ```
187
+ + For Blackwell GPUs, include `--attention-backend triton --speculative-draft-attention-backend triton` in your SGLang launch command.
188
+
189
+ ## Citation
190
+
191
+ If you find our work useful in your research, please consider citing the following paper:
192
+
193
+ ```bibtex
194
+ @misc{5team2025glm45agenticreasoningcoding,
195
+ title={GLM-4.5: Agentic, Reasoning, and Coding (ARC) Foundation Models},
196
+ 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},
197
+ year={2025},
198
+ eprint={2508.06471},
199
+ archivePrefix={arXiv},
200
+ primaryClass={cs.CL},
201
+ url={https://arxiv.org/abs/2508.06471},
202
+ }