Text Generation
Transformers
Safetensors
English
glm4_moe
glm
MOE
pruning
compression
conversational
Instructions to use cerebras/GLM-4.6-REAP-218B-A32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cerebras/GLM-4.6-REAP-218B-A32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cerebras/GLM-4.6-REAP-218B-A32B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cerebras/GLM-4.6-REAP-218B-A32B") model = AutoModelForCausalLM.from_pretrained("cerebras/GLM-4.6-REAP-218B-A32B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cerebras/GLM-4.6-REAP-218B-A32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cerebras/GLM-4.6-REAP-218B-A32B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cerebras/GLM-4.6-REAP-218B-A32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cerebras/GLM-4.6-REAP-218B-A32B
- SGLang
How to use cerebras/GLM-4.6-REAP-218B-A32B 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 "cerebras/GLM-4.6-REAP-218B-A32B" \ --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": "cerebras/GLM-4.6-REAP-218B-A32B", "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 "cerebras/GLM-4.6-REAP-218B-A32B" \ --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": "cerebras/GLM-4.6-REAP-218B-A32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cerebras/GLM-4.6-REAP-218B-A32B with Docker Model Runner:
docker model run hf.co/cerebras/GLM-4.6-REAP-218B-A32B
Commit ·
589b4e0
0
Parent(s):
upload checkpoint
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- README.md +136 -0
- chat_template.jinja +103 -0
- config.json +43 -0
- generation_config.json +10 -0
- model-00001-of-00088.safetensors +3 -0
- model-00002-of-00088.safetensors +3 -0
- model-00003-of-00088.safetensors +3 -0
- model-00004-of-00088.safetensors +3 -0
- model-00005-of-00088.safetensors +3 -0
- model-00006-of-00088.safetensors +3 -0
- model-00007-of-00088.safetensors +3 -0
- model-00008-of-00088.safetensors +3 -0
- model-00009-of-00088.safetensors +3 -0
- model-00010-of-00088.safetensors +3 -0
- model-00011-of-00088.safetensors +3 -0
- model-00012-of-00088.safetensors +3 -0
- model-00013-of-00088.safetensors +3 -0
- model-00014-of-00088.safetensors +3 -0
- model-00015-of-00088.safetensors +3 -0
- model-00016-of-00088.safetensors +3 -0
- model-00017-of-00088.safetensors +3 -0
- model-00018-of-00088.safetensors +3 -0
- model-00019-of-00088.safetensors +3 -0
- model-00020-of-00088.safetensors +3 -0
- model-00021-of-00088.safetensors +3 -0
- model-00022-of-00088.safetensors +3 -0
- model-00023-of-00088.safetensors +3 -0
- model-00024-of-00088.safetensors +3 -0
- model-00025-of-00088.safetensors +3 -0
- model-00026-of-00088.safetensors +3 -0
- model-00027-of-00088.safetensors +3 -0
- model-00028-of-00088.safetensors +3 -0
- model-00029-of-00088.safetensors +3 -0
- model-00030-of-00088.safetensors +3 -0
- model-00031-of-00088.safetensors +3 -0
- model-00032-of-00088.safetensors +3 -0
- model-00033-of-00088.safetensors +3 -0
- model-00034-of-00088.safetensors +3 -0
- model-00035-of-00088.safetensors +3 -0
- model-00036-of-00088.safetensors +3 -0
- model-00037-of-00088.safetensors +3 -0
- model-00038-of-00088.safetensors +3 -0
- model-00039-of-00088.safetensors +3 -0
- model-00040-of-00088.safetensors +3 -0
- model-00041-of-00088.safetensors +3 -0
- model-00042-of-00088.safetensors +3 -0
- model-00043-of-00088.safetensors +3 -0
- model-00044-of-00088.safetensors +3 -0
- model-00045-of-00088.safetensors +3 -0
- model-00046-of-00088.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- glm
|
| 7 |
+
- MOE
|
| 8 |
+
- pruning
|
| 9 |
+
- compression
|
| 10 |
+
license: mit
|
| 11 |
+
name: cerebras/GLM-4.6-REAP-218B-A32B-FP8
|
| 12 |
+
description: >
|
| 13 |
+
This model was obtained by uniformly pruning 40% of experts in GLM-4.6-FP8 using the REAP method.
|
| 14 |
+
readme: >
|
| 15 |
+
https://huggingface.co/cerebras/GLM-4.6-REAP-218B-A32B-FP8/main/README.md
|
| 16 |
+
license_link: https://huggingface.co/zai-org/GLM-4.6-FP8/blob/main/LICENSE
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
base_model:
|
| 19 |
+
- zai-org/GLM-4.6-FP8
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
<p align="center">
|
| 23 |
+
<em>𓌳 <strong>REAP</strong>𓌳 the Experts: Why Pruning Prevails for One-Shot MoE Compression</em><br>
|
| 24 |
+
<img src="https://i.imgur.com/rmzG3gg.png" alt="REAP" width="75%">
|
| 25 |
+
</p>
|
| 26 |
+
|
| 27 |
+
# GLM-4.6-REAP-218B-A32B-FP8
|
| 28 |
+
|
| 29 |
+
## ✨ Highlights
|
| 30 |
+
|
| 31 |
+
Introducing **GLM-4.6-REAP-218B-A32B-FP8**, a **memory-efficient compressed variant** of GLM-4.6-FP8 that maintains near-identical performance while being **40% lighter**.
|
| 32 |
+
|
| 33 |
+
**Note: this is a BF16 version for more accurate downstream low-bit quantization. An [FP8 version](https://huggingface.co/cerebras/GLM-4.6-REAP-218B-A32B-FP8) is also available on HF.**
|
| 34 |
+
|
| 35 |
+
This model was created using **REAP (Router-weighted Expert Activation Pruning)**, a novel expert pruning method that selectively removes redundant experts while preserving the router's independent control over remaining experts. Key features include:
|
| 36 |
+
|
| 37 |
+
- **Near-Lossless Performance**: Maintains almost identical accuracy on code generation, agentic coding, and function calling tasks compared to the full 355B model
|
| 38 |
+
- **40% Memory Reduction**: Compressed from 355B to 218B parameters, significantly lowering deployment costs and memory requirements
|
| 39 |
+
- **Preserved Capabilities**: Retains all core functionalities including code generation, agentic workflows, repository-scale understanding, and function calling
|
| 40 |
+
- **Drop-in Compatibility**: Works with vanilla vLLM - no source modifications or custom patches required
|
| 41 |
+
- **Optimized for Real-World Use**: Particularly effective for resource-constrained environments, local deployments, and academic research
|
| 42 |
+
---
|
| 43 |
+
## 📋 Model Overview
|
| 44 |
+
|
| 45 |
+
**GLM-4.6-REAP-218B-A32B-FP8** has the following specifications:
|
| 46 |
+
|
| 47 |
+
- **Base Model**: GLM-4.6-FP8
|
| 48 |
+
- **Compression Method**: REAP (Router-weighted Expert Activation Pruning)
|
| 49 |
+
- **Compression Ratio**: 40% expert pruning
|
| 50 |
+
- **Type**: Sparse Mixture-of-Experts (SMoE) Causal Language Model
|
| 51 |
+
- **Number of Parameters**: 218B total, 32B activated per token
|
| 52 |
+
- **Number of Layers**: 92
|
| 53 |
+
- **Number of Attention Heads (GQA)**: 96 for Q and 8 for KV
|
| 54 |
+
- **Number of Experts**: 96 (uniformly pruned from 160)
|
| 55 |
+
- **Number of Activated Experts**: 8 per token
|
| 56 |
+
- **Context Length**: 202,752 tokens
|
| 57 |
+
- **License**: MIT
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## 📊 Evaluations
|
| 62 |
+
|
| 63 |
+
TBD for BF16 model. [Evalulation results available for the FP8 variant](https://huggingface.co/cerebras/GLM-4.6-REAP-218B-A32B-FP8#%F0%9F%93%8A-evaluations).
|
| 64 |
+
|
| 65 |
+
For more details on the evaluation setup, refer to the [REAP arXiv preprint](https://arxiv.org/abs/2510.13999).
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## 🚀 Deployment
|
| 70 |
+
|
| 71 |
+
You can deploy the model directly using the **latest vLLM** (v0.11.0), no source modifications or custom patches required.
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
vllm serve cerebras/GLM-4.6-REAP-218B-A32B-FP8 \
|
| 75 |
+
--tensor-parallel-size 8 \
|
| 76 |
+
--tool-call-parser glm45 \
|
| 77 |
+
--enable-auto-tool-choice \
|
| 78 |
+
--enable-expert-parallel
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
If you encounter insufficient memory when running this model, you might need to set a lower value for `--max-num-seqs` flag (e.g. set to 64).
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
## 🧩 Model Creation
|
| 85 |
+
|
| 86 |
+
This checkpoint was created by applying the **REAP (Router-weighted Expert Activation Pruning)** method uniformly across all Mixture-of-Experts (MoE) blocks of **GLM-4.6-FP8**, with a **40% pruning rate**.
|
| 87 |
+
|
| 88 |
+
### How REAP Works
|
| 89 |
+
|
| 90 |
+
REAP selects experts to prune based on a novel **saliency criterion** that considers both:
|
| 91 |
+
- **Router gate values**: How frequently and strongly the router activates each expert
|
| 92 |
+
- **Expert activation norms**: The magnitude of each expert's output contributions
|
| 93 |
+
|
| 94 |
+
This dual consideration ensures that experts contributing minimally to the layer's output are pruned, while preserving those that play critical roles in the model's computations.
|
| 95 |
+
|
| 96 |
+
### Key Advantages
|
| 97 |
+
|
| 98 |
+
- **One-Shot Compression**: No fine-tuning required after pruning - the model is immediately ready for deployment
|
| 99 |
+
- **Preserved Router Control**: Unlike expert merging methods, REAP maintains the router's independent, input-dependent control over remaining experts, avoiding "functional subspace collapse"
|
| 100 |
+
- **Generative Task Superiority**: REAP significantly outperforms expert merging approaches on generative benchmarks (code generation, creative writing, mathematical reasoning) while maintaining competitive performance on discriminative tasks
|
| 101 |
+
|
| 102 |
+
### Calibration
|
| 103 |
+
|
| 104 |
+
The model was calibrated using a diverse mixture of domain-specific datasets including:
|
| 105 |
+
- Code generation samples ([evol-codealpaca](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1))
|
| 106 |
+
- Function calling examples ([xlam-function-calling](https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k))
|
| 107 |
+
- Agentic multi-turn trajectories ([SWE-smith-trajectories](https://huggingface.co/datasets/SWE-bench/SWE-smith-trajectories))
|
| 108 |
+
|
| 109 |
+
📚 For more details, refer to the following resources:
|
| 110 |
+
|
| 111 |
+
- [🧾 arXiv Preprint](https://arxiv.org/abs/2510.13999)
|
| 112 |
+
- [🧾 REAP Blog](https://www.cerebras.ai/blog/reap)
|
| 113 |
+
- [💻 REAP Codebase (GitHub)](https://github.com/CerebrasResearch/reap)
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## ⚖️ License
|
| 118 |
+
|
| 119 |
+
This model is derived from
|
| 120 |
+
**[`zai-org/GLM-4.6-FP8`](https://huggingface.co/zai-org/GLM-4.6-FP8)**
|
| 121 |
+
and distributed under the **MIT license**.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## 🧾 Citation
|
| 126 |
+
|
| 127 |
+
If you use this checkpoint, please cite the REAP paper:
|
| 128 |
+
|
| 129 |
+
```bibtex
|
| 130 |
+
@article{lasby-reap,
|
| 131 |
+
title={REAP the Experts: Why Pruning Prevails for One-Shot MoE compression},
|
| 132 |
+
author={Lasby, Mike and Lazarevich, Ivan and Sinnadurai, Nish and Lie, Sean and Ioannou, Yani and Thangarasa, Vithursan},
|
| 133 |
+
journal={arXiv preprint arXiv:2510.13999},
|
| 134 |
+
year={2025}
|
| 135 |
+
}
|
| 136 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}
|
| 17 |
+
<arg_key>{arg-key-1}</arg_key>
|
| 18 |
+
<arg_value>{arg-value-1}</arg_value>
|
| 19 |
+
<arg_key>{arg-key-2}</arg_key>
|
| 20 |
+
<arg_value>{arg-value-2}</arg_value>
|
| 21 |
+
...
|
| 22 |
+
</tool_call>{%- endif -%}
|
| 23 |
+
{%- macro visible_text(content) -%}
|
| 24 |
+
{%- if content is string -%}
|
| 25 |
+
{{- content }}
|
| 26 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 27 |
+
{%- for item in content -%}
|
| 28 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 29 |
+
{{- item.text }}
|
| 30 |
+
{%- elif item is string -%}
|
| 31 |
+
{{- item }}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
{%- endfor -%}
|
| 34 |
+
{%- else -%}
|
| 35 |
+
{{- content }}
|
| 36 |
+
{%- endif -%}
|
| 37 |
+
{%- endmacro -%}
|
| 38 |
+
{%- set ns = namespace(last_user_index=-1) %}
|
| 39 |
+
{%- for m in messages %}
|
| 40 |
+
{%- if m.role == 'user' %}
|
| 41 |
+
{% set ns.last_user_index = loop.index0 -%}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- endfor %}
|
| 44 |
+
{% for m in messages %}
|
| 45 |
+
{%- if m.role == 'user' -%}<|user|>
|
| 46 |
+
{{ visible_text(m.content) }}
|
| 47 |
+
{{- '/nothink' if (enable_thinking is defined and not enable_thinking and not visible_text(m.content).endswith("/nothink")) else '' -}}
|
| 48 |
+
{%- elif m.role == 'assistant' -%}
|
| 49 |
+
<|assistant|>
|
| 50 |
+
{%- set reasoning_content = '' %}
|
| 51 |
+
{%- set content = visible_text(m.content) %}
|
| 52 |
+
{%- if m.reasoning_content is string %}
|
| 53 |
+
{%- set reasoning_content = m.reasoning_content %}
|
| 54 |
+
{%- else %}
|
| 55 |
+
{%- if '</think>' in content %}
|
| 56 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 57 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{%- if loop.index0 > ns.last_user_index and reasoning_content -%}
|
| 61 |
+
{{ '\n<think>' + reasoning_content.strip() + '</think>'}}
|
| 62 |
+
{%- else -%}
|
| 63 |
+
{{ '\n<think></think>' }}
|
| 64 |
+
{%- endif -%}
|
| 65 |
+
{%- if content.strip() -%}
|
| 66 |
+
{{ '\n' + content.strip() }}
|
| 67 |
+
{%- endif -%}
|
| 68 |
+
{% if m.tool_calls %}
|
| 69 |
+
{% for tc in m.tool_calls %}
|
| 70 |
+
{%- if tc.function %}
|
| 71 |
+
{%- set tc = tc.function %}
|
| 72 |
+
{%- endif %}
|
| 73 |
+
{{ '\n<tool_call>' + tc.name }}
|
| 74 |
+
{% set _args = tc.arguments %}
|
| 75 |
+
{% for k, v in _args.items() %}
|
| 76 |
+
<arg_key>{{ k }}</arg_key>
|
| 77 |
+
<arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>
|
| 78 |
+
{% endfor %}
|
| 79 |
+
</tool_call>{% endfor %}
|
| 80 |
+
{% endif %}
|
| 81 |
+
{%- elif m.role == 'tool' -%}
|
| 82 |
+
{%- if m.content is string -%}
|
| 83 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 84 |
+
{{- '<|observation|>' }}
|
| 85 |
+
{%- endif %}
|
| 86 |
+
{{- '\n<tool_response>\n' }}
|
| 87 |
+
{{- m.content }}
|
| 88 |
+
{{- '\n</tool_response>' }}
|
| 89 |
+
{%- else -%}
|
| 90 |
+
<|observation|>{% for tr in m.content %}
|
| 91 |
+
|
| 92 |
+
<tool_response>
|
| 93 |
+
{{ tr.output if tr.output is defined else tr }}
|
| 94 |
+
</tool_response>{% endfor -%}
|
| 95 |
+
{% endif -%}
|
| 96 |
+
{%- elif m.role == 'system' -%}
|
| 97 |
+
<|system|>
|
| 98 |
+
{{ visible_text(m.content) }}
|
| 99 |
+
{%- endif -%}
|
| 100 |
+
{%- endfor -%}
|
| 101 |
+
{%- if add_generation_prompt -%}
|
| 102 |
+
<|assistant|>{{- '\n<think></think>' if (enable_thinking is defined and not enable_thinking) else '' -}}
|
| 103 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Glm4MoeForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": true,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"eos_token_id": [
|
| 8 |
+
151329,
|
| 9 |
+
151336,
|
| 10 |
+
151338
|
| 11 |
+
],
|
| 12 |
+
"first_k_dense_replace": 3,
|
| 13 |
+
"head_dim": 128,
|
| 14 |
+
"hidden_act": "silu",
|
| 15 |
+
"hidden_size": 5120,
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 12288,
|
| 18 |
+
"max_position_embeddings": 202752,
|
| 19 |
+
"model_type": "glm4_moe",
|
| 20 |
+
"moe_intermediate_size": 1536,
|
| 21 |
+
"n_group": 1,
|
| 22 |
+
"n_routed_experts": 96,
|
| 23 |
+
"n_shared_experts": 1,
|
| 24 |
+
"norm_topk_prob": true,
|
| 25 |
+
"num_attention_heads": 96,
|
| 26 |
+
"num_experts_per_tok": 8,
|
| 27 |
+
"num_hidden_layers": 92,
|
| 28 |
+
"num_key_value_heads": 8,
|
| 29 |
+
"num_nextn_predict_layers": 0,
|
| 30 |
+
"pad_token_id": 151329,
|
| 31 |
+
"partial_rotary_factor": 0.5,
|
| 32 |
+
"rms_norm_eps": 1e-05,
|
| 33 |
+
"rope_scaling": null,
|
| 34 |
+
"rope_theta": 1000000,
|
| 35 |
+
"routed_scaling_factor": 2.5,
|
| 36 |
+
"tie_word_embeddings": false,
|
| 37 |
+
"topk_group": 1,
|
| 38 |
+
"torch_dtype": "bfloat16",
|
| 39 |
+
"transformers_version": "4.55.0",
|
| 40 |
+
"use_cache": true,
|
| 41 |
+
"use_qk_norm": true,
|
| 42 |
+
"vocab_size": 151552
|
| 43 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151329,
|
| 5 |
+
151336,
|
| 6 |
+
151338
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 151329,
|
| 9 |
+
"transformers_version": "4.55.0"
|
| 10 |
+
}
|
model-00001-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f213cb52e38e58b4df71754baf8e79463d4732e3bd3f9e193b6f360accf3206e
|
| 3 |
+
size 4986172552
|
model-00002-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3967c803a41450bd06b6e89bfc1de39f5a329a69f8fa6beab4170072f85a41e0
|
| 3 |
+
size 4992293480
|
model-00003-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7b804b069cee3e5816a7a645b28057d6b1d2a80986d9e59d18ded802ad440d0
|
| 3 |
+
size 4992293480
|
model-00004-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f93ccc1ae9e84c2cfa143fa72f0c75bb66b95877d88f1ace178da02f96cda078
|
| 3 |
+
size 4992293480
|
model-00005-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e1adfaa0d65ee00726d606ec247e68a366e029f73ecd8252e6dc7d4663c72d8
|
| 3 |
+
size 4992293480
|
model-00006-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e27a78820dbf46e3bd4fecb4211ffa084fe2010801285429dfa29b6d9bbf5b73
|
| 3 |
+
size 4992293480
|
model-00007-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6665027edc55b86bfd431ea6cea1b097e1b1205ace0ed728b3b288901e9031ab
|
| 3 |
+
size 4992293480
|
model-00008-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3a6269274922c643b21799bebe33bfb0b6575f43a498bae4ec3b93739f6997c4
|
| 3 |
+
size 4992293640
|
model-00009-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c991949a091038d04a95171128d75453576051ef68aed6c82fe094df8616f88a
|
| 3 |
+
size 4992293792
|
model-00010-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c2bbd267acc7a5655741d9951d7d2b5cee22c8a8265dfb7cfa94ba92afc3749
|
| 3 |
+
size 4992293792
|
model-00011-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13e01bfb105bbc52e7ee077103ee0fa13aacfe26f17fde3bc9f77694b96f6ea2
|
| 3 |
+
size 4992293792
|
model-00012-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2008f34d590922db4f557d8ce8426f35a1513303a6aaaa1391fd5fff99f7f31
|
| 3 |
+
size 4992293792
|
model-00013-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1b5b1a419a917a80d76e1edd6f71e53834ee835be3652fcb43603b9e0eb43e4
|
| 3 |
+
size 4992293792
|
model-00014-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a9103e86f9916abab2d7f5bd791d7bfe137242068ca5a6e8f01a7123a0cfe20
|
| 3 |
+
size 4992293792
|
model-00015-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e9cebf42037176c056b09eabebd81b1eaf1143414e4cd8a12b7e2fc8b2d01caf
|
| 3 |
+
size 4992293792
|
model-00016-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:acbaad1879ebaedb156a7f37ab8ea6abc0e4b8694880e4c88db4a872ef359e49
|
| 3 |
+
size 4992293792
|
model-00017-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b81d419097e8ae6272f8b3f04d3130dec68c72597fc9fa81c0754587359df57
|
| 3 |
+
size 4992293792
|
model-00018-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff581dcedcdc0435eb9b8e2e103f54fafed4c90781bb12989cc0e9379a22d7a9
|
| 3 |
+
size 4992293792
|
model-00019-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b08644d1a29b0a94433e1072d063a46cfb060f601c559e49a5962092511259f
|
| 3 |
+
size 4992293792
|
model-00020-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ffe695d19fd52c544eaf05ddcd39bd63bafd3418820adae251590217f1b0973
|
| 3 |
+
size 4992293792
|
model-00021-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68c11b4bab1e82683f10b26a59ade004c9d00f5119c5a8723d3f677d58b9aa14
|
| 3 |
+
size 4992293792
|
model-00022-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:501e96e832463df6cac1fed2c9f3a7b478d2f4538d660c6757d2479e61ca0260
|
| 3 |
+
size 4992293792
|
model-00023-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7086a8f45e58a736746bf850b9bbe565873bcea99d067adae7888199f8090c25
|
| 3 |
+
size 4992293792
|
model-00024-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4444ddf6719f671447a337e35aaebb87c1a37dc8a5456a58b235898316859f14
|
| 3 |
+
size 4992293792
|
model-00025-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47c917a252bd745880e9bde73dcc6f2d5b28835a0a1a53c6b3bfb31fc101fe8c
|
| 3 |
+
size 4961840616
|
model-00026-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0e21bd9a493d1b48fb883c18ced7c5e237ddd2d92b2325ac318c2f14712b102
|
| 3 |
+
size 4997564904
|
model-00027-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:076f7df82cb2a2b07c6fb6ae5f9a9d81120716c6293c96c84be5371b7b605cb6
|
| 3 |
+
size 4992293648
|
model-00028-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:214ee7b9cbf2b814186b8485e5c0a6dd679286e1dedbb1986ee29cbd243a3729
|
| 3 |
+
size 4992293784
|
model-00029-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:672a4625ab1d3eb13d67fdc44e1ef694ed968f6846a9297f8264f3582f57f5a7
|
| 3 |
+
size 4992293784
|
model-00030-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6fcca6e532ff06f16b643263618801f7d5fcdbcb6a1a2c2f47b425503ea7e3c
|
| 3 |
+
size 4992293784
|
model-00031-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:300677074feb61f932309518db12bf616e5ab531f560d382f148bcc705d029e2
|
| 3 |
+
size 4992293792
|
model-00032-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed488b0edcbacdcd690430843068ce20c066dd820c66e75931c1a2161fc790bc
|
| 3 |
+
size 4992293792
|
model-00033-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74183f9ef9b234c322d4cc0fa5785883e1709957be32b8c13c165fa0f1607f07
|
| 3 |
+
size 4992293792
|
model-00034-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8827b19e6efc63650f8d6bd8adfbb5391ce8ed01d5380c55dfc0518878ef4e50
|
| 3 |
+
size 4992293792
|
model-00035-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:922416ce9661049e00b5feec19d1d11faf6f25cde56c47d6d008f82e2e828b52
|
| 3 |
+
size 4992293792
|
model-00036-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f8292739cafc758cdb755d6bb4a14f77436580cce3d01391af37cefc7c7b9e7
|
| 3 |
+
size 4992293792
|
model-00037-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e4faa56cd877b62e41e10c9e7be27fdcee67280ab75053d83a0f4a47ad8b2ba
|
| 3 |
+
size 4992293792
|
model-00038-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15cdaec9523176d1d06b3daf8638f4c38b3701c593f38455321f93e8a84a81d0
|
| 3 |
+
size 4992293792
|
model-00039-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c70f49e68d5f76da7de5a373f66f3d430bbc2134d116e90a67450a16f09a2614
|
| 3 |
+
size 4992293792
|
model-00040-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86a45cf9a15093f168136d69461b90cd7ef0c625c3bbe6eb3b498b98f2b52c1c
|
| 3 |
+
size 4992293792
|
model-00041-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09edce6fe6009c31bd6fc2db9e71f835fba8e6ecc0966cb620d47c6e431fbaef
|
| 3 |
+
size 4992293792
|
model-00042-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a0a0327319e646fe6c2ebba06ef968e03e55ebeaacfe46be8a5bbf7f685eb28
|
| 3 |
+
size 4992293792
|
model-00043-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb0d235a1847cd1fbb7b9532e69c6d1d3e5942bf4713bd01326be8597a2e553f
|
| 3 |
+
size 4992293792
|
model-00044-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:daf3b00726c8b74313c309066422852d7bdb0e1620be77cfe9c12cff74a110db
|
| 3 |
+
size 4992293792
|
model-00045-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d05f7e1819825fdc69bca19143f11304d64984f8f8d190da27cc8f15c57d235
|
| 3 |
+
size 4992293792
|
model-00046-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bd5a0b3fe1430b775829635f941fd4f9a9fd13a25ed3e4bad5c3eedf5bbf54b
|
| 3 |
+
size 4992293792
|