Pinaster commited on
Commit
54ecb6b
·
verified ·
1 Parent(s): a29ffd0

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. README.md +152 -0
  3. chat_template.jinja +86 -0
  4. config.json +63 -0
  5. configuration_deepseek_v32.py +61 -0
  6. generation_config.json +12 -0
  7. model-00001-of-00282.safetensors +3 -0
  8. model-00002-of-00282.safetensors +3 -0
  9. model-00003-of-00282.safetensors +3 -0
  10. model-00004-of-00282.safetensors +3 -0
  11. model-00005-of-00282.safetensors +3 -0
  12. model-00006-of-00282.safetensors +3 -0
  13. model-00007-of-00282.safetensors +3 -0
  14. model-00008-of-00282.safetensors +3 -0
  15. model-00009-of-00282.safetensors +3 -0
  16. model-00010-of-00282.safetensors +3 -0
  17. model-00011-of-00282.safetensors +3 -0
  18. model-00012-of-00282.safetensors +3 -0
  19. model-00013-of-00282.safetensors +3 -0
  20. model-00014-of-00282.safetensors +3 -0
  21. model-00015-of-00282.safetensors +3 -0
  22. model-00016-of-00282.safetensors +3 -0
  23. model-00017-of-00282.safetensors +3 -0
  24. model-00018-of-00282.safetensors +3 -0
  25. model-00019-of-00282.safetensors +3 -0
  26. model-00020-of-00282.safetensors +3 -0
  27. model-00021-of-00282.safetensors +3 -0
  28. model-00022-of-00282.safetensors +3 -0
  29. model-00023-of-00282.safetensors +3 -0
  30. model-00024-of-00282.safetensors +3 -0
  31. model-00025-of-00282.safetensors +3 -0
  32. model-00026-of-00282.safetensors +3 -0
  33. model-00027-of-00282.safetensors +3 -0
  34. model-00028-of-00282.safetensors +3 -0
  35. model-00029-of-00282.safetensors +3 -0
  36. model-00030-of-00282.safetensors +3 -0
  37. model-00031-of-00282.safetensors +3 -0
  38. model-00032-of-00282.safetensors +3 -0
  39. model-00033-of-00282.safetensors +3 -0
  40. model-00034-of-00282.safetensors +3 -0
  41. model-00035-of-00282.safetensors +3 -0
  42. model-00036-of-00282.safetensors +3 -0
  43. model-00037-of-00282.safetensors +3 -0
  44. model-00038-of-00282.safetensors +3 -0
  45. model-00039-of-00282.safetensors +3 -0
  46. model-00075-of-00282.safetensors +3 -0
  47. model-00076-of-00282.safetensors +3 -0
  48. model-00077-of-00282.safetensors +3 -0
  49. model-00078-of-00282.safetensors +3 -0
  50. model-00079-of-00282.safetensors +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - zh
5
+ library_name: transformers
6
+ license: mit
7
+ pipeline_tag: text-generation
8
+ ---
9
+
10
+ # GLM-5
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 <a href="https://z.ai/blog/glm-5" target="_blank">technical blog</a>.
19
+ <br>
20
+ 📍 Use GLM-5 API services on <a href="https://docs.z.ai/guides/llm/glm-5">Z.ai API Platform. </a>
21
+ <br>
22
+ 👉 One click to <a href="https://chat.z.ai">GLM-5</a>.
23
+ </p>
24
+
25
+ ## Introduction
26
+
27
+ We are launching GLM-5, targeting complex systems engineering and long-horizon agentic tasks. Scaling is still one of the most important ways to improve the intelligence efficiency of Artificial General Intelligence (AGI). Compared to GLM-4.5, GLM-5 scales from 355B parameters (32B active) to 744B parameters (40B active), and increases pre-training data from 23T to 28.5T tokens. GLM-5 also integrates DeepSeek Sparse Attention (DSA), largely reducing deployment cost while preserving long-context capacity.
28
+
29
+ Reinforcement learning aims to bridge the gap between competence and excellence in pre-trained models. However, deploying it at scale for LLMs is a challenge due to the RL training inefficiency. To this end, we developed [slime](https://github.com/THUDM/slime), a novel **asynchronous RL infrastructure** that substantially improves training throughput and efficiency, enabling more fine-grained post-training iterations. With advances in both pre-training and post-training, GLM-5 delivers significant improvement compared to GLM-4.7 across a wide range of academic benchmarks and achieves best-in-class performance among all open-source models in the world on reasoning, coding, and agentic tasks, closing the gap with frontier models.
30
+
31
+ ## Benchmark
32
+
33
+ | | GLM-5 | GLM-4.7 | DeepSeek-V3.2 | Kimi K2.5 | Claude Opus 4.5 | Gemini 3 Pro | GPT-5.2 (xhigh) |
34
+ | -------------------------------- | ---------------------- | --------- | ------------- |-----------| --------------- | ------------ | --------------- |
35
+ | HLE | 30.5 | 24.8 | 25.1 | 31.5 | 28.4 | 37.2 | 35.4 |
36
+ | HLE (w/ Tools) | 50.4 | 42.8 | 40.8 | 51.8 | 43.4* | 45.8* | 45.5* |
37
+ | AIME 2026 I | 92.7 | 92.9 | 92.7 | 92.5 | 93.3 | 90.6 | - |
38
+ | HMMT Nov. 2025 | 96.9 | 93.5 | 90.2 | 91.1 | 91.7 | 93.0 | 97.1 |
39
+ | IMOAnswerBench | 82.5 | 82.0 | 78.3 | 81.8 | 78.5 | 83.3 | 86.3 |
40
+ | GPQA-Diamond | 86.0 | 85.7 | 82.4 | 87.6 | 87.0 | 91.9 | 92.4 |
41
+ | SWE-bench Verified | 77.8 | 73.8 | 73.1 | 76.8 | 80.9 | 76.2 | 80.0 |
42
+ | SWE-bench Multilingual | 73.3 | 66.7 | 70.2 | 73.0 | 77.5 | 65.0 | 72.0 |
43
+ | Terminal-Bench 2.0 (Terminus 2) | 56.2 / 60.7 † | 41.0 | 39.3 | 50.8 | 59.3 | 54.2 | 54.0 |
44
+ | Terminal-Bench 2.0 (Claude Code) | 56.2 / 61.1 † | 32.8 | 46.4 | - | 57.9 | - | - |
45
+ | CyberGym | 43.2 | 23.5 | 17.3 | 41.3 | 50.6 | 39.9 | - |
46
+ | BrowseComp | 62.0 | 52.0 | 51.4 | 60.6 | 37.0 | 37.8 | - |
47
+ | BrowseComp (w/ Context Manage) | 75.9 | 67.5 | 67.6 | 74.9 | 67.8 | 59.2 | 65.8 |
48
+ | BrowseComp-Zh | 72.7 | 66.6 | 65.0 | 62.3 | 62.4 | 66.8 | 76.1 |
49
+ | τ²-Bench | 89.7 | 87.4 | 85.3 | 80.2 | 91.6 | 90.7 | 85.5 |
50
+ | MCP-Atlas (Public Set) | 67.8 | 52.0 | 62.2 | 63.8 | 65.2 | 66.6 | 68.0 |
51
+ | Tool-Decathlon | 38.0 | 23.8 | 35.2 | 27.8 | 43.5 | 36.4 | 46.3 |
52
+ | Vending Bench 2 | $4,432.12 | $2,376.82 | $1,034.00 | $1,198.46 | $4,967.06 | $5,478.16 | $3,591.33 |
53
+
54
+ > *: refers to their scores of full set.
55
+ >
56
+ > †: A verified version of Terminal-Bench 2.0 that fixes some ambiguous instructions.
57
+ See footnote for more evaluation details.
58
+
59
+ ### Footnote
60
+
61
+ * **Humanity’s Last Exam (HLE) & other reasoning tasks**: We evaluate with a maximum generation length of 131,072 tokens (`temperature=1.0, top_p=0.95, max_new_tokens=131072`). By default, we report the text-only subset; results marked with * are from the full set. We use GPT-5.2 (medium) as the judge model. For HLE-with-tools, we use a maximum context length of 202,752 tokens.
62
+ * **SWE-bench & SWE-bench Multilingual**: We run the SWE-bench suite with OpenHands using a tailored instruction prompt. Settings: `temperature=0.7, top_p=0.95, max_new_tokens=16384`, with a 200K context window.
63
+ * **BrowserComp**: Without context management, we retain details from the most recent 5 turns. With context management, we use the same discard-all strategy as DeepSeek-v3.2 and Kimi K2.5.
64
+ * **Terminal-Bench 2.0 (Terminus 2)**: We evaluate with the Terminus framework using `timeout=2h, temperature=0.7, top_p=1.0, max_new_tokens=8192`, with a 128K context window. Resource limits are capped at 16 CPUs and 32 GB RAM.
65
+ * **Terminal-Bench 2.0 (Claude Code)**: We evaluate in Claude Code 2.1.14 (think mode, default effort) with `temperature=1.0, top_p=0.95, max_new_tokens=65536`. We remove wall-clock time limits due to generation speed, while preserving per-task CPU and memory constraints. Scores are averaged over 5 runs. We fix environment issues introduced by Claude Code and also report results on a verified Terminal-Bench 2.0 dataset that resolves ambiguous instructions (see: [https://huggingface.co/datasets/zai-org/terminal-bench-2-verified](https://huggingface.co/datasets/zai-org/terminal-bench-2-verified)).
66
+ * **CyberGym**: We evaluate in Claude Code 2.1.18 (think mode, no web tools) with (`temperature=1.0, top_p=1.0, max_new_tokens=32000`) and a 250-minute timeout per task. Results are single-run Pass@1 over 1,507 tasks.
67
+ * **MCP-Atlas**: All models are evaluated in think mode on the 500-task public subset with a 10-minute timeout per task. We use Gemini 3 Pro as the judge model.
68
+ * **τ²-bench**: We add a small prompt adjustment in Retail and Telecom to avoid failures caused by premature user termination. For Airline, we apply the domain fixes proposed in the Claude Opus 4.5 system card.
69
+ * **Vending Bench 2**: Runs are conducted independently by [Andon Labs](https://andonlabs.com/evals/vending-bench-2).
70
+
71
+
72
+ ## Serve GLM-5 Locally
73
+
74
+ ### Prepare environment
75
+
76
+ vLLM, SGLang, KTransformers, and xLLM all support local deployment of GLM-5. A simple deployment guide is provided here.
77
+
78
+ + vLLM
79
+
80
+ Using Docker as:
81
+
82
+ ```shell
83
+ docker pull vllm/vllm-openai:nightly
84
+ ```
85
+
86
+ or using pip:
87
+
88
+ ```shell
89
+ pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
90
+ ```
91
+
92
+ then upgrade transformers:
93
+
94
+ ```
95
+ pip install git+https://github.com/huggingface/transformers.git
96
+ ```
97
+
98
+ + SGLang
99
+
100
+ Using Docker as:
101
+ ```bash
102
+ docker pull lmsysorg/sglang:glm5-hopper # For Hopper GPU
103
+ docker pull lmsysorg/sglang:glm5-blackwell # For Blackwell GPU
104
+ ```
105
+
106
+ ### Deploy
107
+
108
+ + vLLM
109
+
110
+ ```shell
111
+ vllm serve zai-org/GLM-5-FP8 \
112
+ --tensor-parallel-size 8 \
113
+ --gpu-memory-utilization 0.85 \
114
+ --speculative-config.method mtp \
115
+ --speculative-config.num_speculative_tokens 1 \
116
+ --tool-call-parser glm47 \
117
+ --reasoning-parser glm45 \
118
+ --enable-auto-tool-choice \
119
+ --served-model-name glm-5-fp8
120
+ ```
121
+
122
+ Check the [recipes](https://github.com/vllm-project/recipes/blob/main/GLM/GLM5.md) for more details.
123
+
124
+ + SGLang
125
+
126
+ ```shell
127
+ python3 -m sglang.launch_server \
128
+ --model-path zai-org/GLM-5-FP8 \
129
+ --tp-size 8 \
130
+ --tool-call-parser glm47 \
131
+ --reasoning-parser glm45 \
132
+ --speculative-algorithm EAGLE \
133
+ --speculative-num-steps 3 \
134
+ --speculative-eagle-topk 1 \
135
+ --speculative-num-draft-tokens 4 \
136
+ --mem-fraction-static 0.85 \
137
+ --served-model-name glm-5-fp8
138
+ ```
139
+
140
+ Check the [sglang cookbook](https://cookbook.sglang.io/autoregressive/GLM/GLM-5) for more details.
141
+
142
+ + xLLM and other Ascend NPU
143
+
144
+ Please check the deployment guide [here](https://github.com/zai-org/GLM-5/blob/main/example/ascend.md).
145
+
146
+ + KTransformers
147
+
148
+ Please check the deployment guide [here](https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/kt-kernel/GLM-5-Tutorial.md).
149
+
150
+ ## Citation
151
+
152
+ Our technical report is coming soon.
chat_template.jinja ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [gMASK]<sop>
2
+ {%- if tools -%}
3
+ <|system|>
4
+ # Tools
5
+
6
+ You may call one or more functions to assist with the user query.
7
+
8
+ You are provided with function signatures within <tools></tools> XML tags:
9
+ <tools>
10
+ {% for tool in tools %}
11
+ {{ tool | tojson(ensure_ascii=False) }}
12
+ {% endfor %}
13
+ </tools>
14
+
15
+ For each function call, output the function name and arguments within the following XML format:
16
+ <tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
17
+ {%- macro visible_text(content) -%}
18
+ {%- if content is string -%}
19
+ {{- content }}
20
+ {%- elif content is iterable and content is not mapping -%}
21
+ {%- for item in content -%}
22
+ {%- if item is mapping and item.type == 'text' -%}
23
+ {{- item.text }}
24
+ {%- elif item is string -%}
25
+ {{- item }}
26
+ {%- endif -%}
27
+ {%- endfor -%}
28
+ {%- else -%}
29
+ {{- content }}
30
+ {%- endif -%}
31
+ {%- endmacro -%}
32
+ {%- set ns = namespace(last_user_index=-1) %}
33
+ {%- for m in messages %}
34
+ {%- if m.role == 'user' %}
35
+ {% set ns.last_user_index = loop.index0 -%}
36
+ {%- endif %}
37
+ {%- endfor %}
38
+ {% for m in messages %}
39
+ {%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
40
+ {%- elif m.role == 'assistant' -%}
41
+ <|assistant|>
42
+ {%- set reasoning_content = '' %}
43
+ {%- set content = visible_text(m.content) %}
44
+ {%- if m.reasoning_content is string %}
45
+ {%- set reasoning_content = m.reasoning_content %}
46
+ {%- else %}
47
+ {%- if '</think>' in content %}
48
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
49
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
50
+ {%- endif %}
51
+ {%- endif %}
52
+ {%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}
53
+ {{ '<think>' + reasoning_content.strip() + '</think>'}}
54
+ {%- else -%}
55
+ {{ '</think>' }}
56
+ {%- endif -%}
57
+ {%- if content.strip() -%}
58
+ {{ content.strip() }}
59
+ {%- endif -%}
60
+ {% if m.tool_calls %}
61
+ {% for tc in m.tool_calls %}
62
+ {%- if tc.function %}
63
+ {%- set tc = tc.function %}
64
+ {%- endif %}
65
+ {{- '<tool_call>' + tc.name -}}
66
+ {% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
67
+ {% endif %}
68
+ {%- elif m.role == 'tool' -%}
69
+ {%- if m.content is string -%}
70
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
71
+ {{- '<|observation|>' }}
72
+ {%- endif %}
73
+ {{- '<tool_response>' }}
74
+ {{- m.content }}
75
+ {{- '</tool_response>' }}
76
+ {%- else -%}
77
+ <|observation|>{% for tr in m.content %}
78
+ <tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}
79
+ {% endif -%}
80
+ {%- elif m.role == 'system' -%}
81
+ <|system|>{{ visible_text(m.content) }}
82
+ {%- endif -%}
83
+ {%- endfor -%}
84
+ {%- if add_generation_prompt -%}
85
+ <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
86
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DeepseekV32ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": [
9
+ 154820,
10
+ 154827,
11
+ 154829
12
+ ],
13
+ "ep_size": 1,
14
+ "first_k_dense_replace": 3,
15
+ "hidden_act": "silu",
16
+ "head_dim": 64,
17
+ "hidden_size": 6144,
18
+ "index_head_dim": 128,
19
+ "index_n_heads": 32,
20
+ "index_topk": 2048,
21
+ "indexer_rope_interleave": true,
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 12288,
24
+ "kv_lora_rank": 512,
25
+ "max_position_embeddings": 202752,
26
+ "moe_intermediate_size": 2048,
27
+ "moe_layer_freq": 1,
28
+ "model_type": "deepseek_v32",
29
+ "n_group": 1,
30
+ "n_routed_experts": 256,
31
+ "n_shared_experts": 1,
32
+ "norm_topk_prob": true,
33
+ "num_attention_heads": 64,
34
+ "num_experts_per_tok": 8,
35
+ "num_hidden_layers": 20,
36
+ "num_key_value_heads": 64,
37
+ "num_nextn_predict_layers": 1,
38
+ "pad_token_id": 154820,
39
+ "pretraining_tp": 1,
40
+ "q_lora_rank": 2048,
41
+ "qk_head_dim": 256,
42
+ "qk_nope_head_dim": 192,
43
+ "qk_rope_head_dim": 64,
44
+ "rms_norm_eps": 1e-05,
45
+ "rope_interleave": true,
46
+ "rope_parameters": {
47
+ "rope_theta": 1000000,
48
+ "rope_type": "default"
49
+ },
50
+ "routed_scaling_factor": 2.5,
51
+ "scoring_func": "sigmoid",
52
+ "tie_word_embeddings": false,
53
+ "topk_group": 1,
54
+ "topk_method": "noaux_tc",
55
+ "transformers_version": "5.0.2.dev0",
56
+ "use_cache": true,
57
+ "v_head_dim": 256,
58
+ "vocab_size": 154880,
59
+ "auto_map": {
60
+ "AutoConfig": "configuration_deepseek_v32.DeepseekV32Config",
61
+ "AutoModelForCausalLM": "modeling_deepseek_v32.DeepseekV32ForCausalLM"
62
+ }
63
+ }
configuration_deepseek_v32.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2025 bzantium and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on the DeepSeekV3 implementations from the DeepSeek AI team. (https://huggingface.co/deepseek-ai/DeepSeek-V3)
5
+
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ """DeepSeekV3.2 model configuration"""
18
+
19
+ from typing import Optional
20
+
21
+ from transformers.models.deepseek_v3.configuration_deepseek_v3 import DeepseekV3Config
22
+
23
+
24
+ DEEPSEEK_V32_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
25
+
26
+
27
+ class DeepseekV32Config(DeepseekV3Config):
28
+ r"""
29
+ This is the configuration class to store the configuration of a [`DeepseekV32Model`]. It is used to instantiate a DeepSeek
30
+ V3.2 model according to the specified arguments, defining the model architecture.
31
+
32
+ DeepSeek V3.2 extends DeepSeek V3 with native sparse attention mechanism using an indexer for efficient
33
+ attention computation on long sequences.
34
+ Configuration objects inherit from [`DeepseekV3Config`] and can be used to control the model outputs. Read the
35
+ documentation from [`PreTrainedConfig`] for more information.
36
+ Args:
37
+ index_topk (`int`, *optional*, defaults to 2048):
38
+ Number of top-k tokens to select for sparse attention. This enables the native sparse attention
39
+ mechanism in DeepSeek V3.2.
40
+ **kwargs:
41
+ All other arguments from DeepseekV3Config.
42
+ ```python
43
+ >>> from transformers import DeepseekV32Model, DeepseekV32Config
44
+ >>> # Initializing a Deepseek-V3.2 style configuration
45
+ >>> configuration = DeepseekV32Config()
46
+ >>> # Accessing the model configuration
47
+ >>> configuration = model.config
48
+ ```"""
49
+
50
+ model_type = "deepseek_v32"
51
+
52
+ def __init__(
53
+ self,
54
+ index_topk: Optional[int] = 2048,
55
+ **kwargs,
56
+ ):
57
+ super().__init__(**kwargs)
58
+ self.index_topk = index_topk
59
+
60
+
61
+ __all__ = ["DeepseekV32Config"]
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.0.2.dev0"
12
+ }
model-00001-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:198ef923a7ca4effc5ead8ebf799fee10beb8ce081352fb099636f805d1deda9
3
+ size 5342821416
model-00002-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f41e14a00f8f65b5ddae90afc9aee29745bbe38821090b78dfc18f8b2be25738
3
+ size 5351970840
model-00003-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5f696f543a4473b272bb38068bec2a5fa2ce6b00306b99e7b7264ac9a4784ea
3
+ size 5360347320
model-00004-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21ea9316694ec51d00be3a54f4c90c6b8c927e9f9852aa673234ce10ea46b092
3
+ size 5360347208
model-00005-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:447d3150fda6a4a95063c52402cc32a5e185e94ccb8ab1162463a6dec34d1130
3
+ size 5359985352
model-00006-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bd92a8fb83f562439f97700404160da10f43d0c18b0e2ac900128c921ddd8d7
3
+ size 5360347320
model-00007-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca57320e2c33917441d7ade047ea155fc630d0fa1f7933946e209486174aa12b
3
+ size 5360347320
model-00008-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e848c982bf3fdcb5b7d8704e20e4b30aaff0d85f7314713dc82f3e069fb2d2cd
3
+ size 5360347144
model-00009-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67d50e69f80e4f0959e6af2ed383aad04d3e930c5788b148b692df10652e8953
3
+ size 5359985416
model-00010-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a18aa0bb8201311c1c31e462e3885f26299e6d025d9ff9cef40c899df3384e0
3
+ size 5360347312
model-00011-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86ae5f0fe4ca9bd26926ff5feb2f8eea2524ff851bac18920180a74d5829f01b
3
+ size 5360347288
model-00012-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1da09cf92af76c5271f500bb204b581e8fa79d086ea0b980f739c00e75a13d83
3
+ size 5363494088
model-00013-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c06dc21e2bd376abdcf28dea362f00511f50a449bbcec299fe6cd1842d248ce
3
+ size 5356838488
model-00014-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:213d05d35132ab6c76771ccc87d9798b3417505f1456900fc111d1aa2dafafb5
3
+ size 5360347312
model-00015-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b04e317d274bed49d942c5d6f99565ab80149a588528ce9208d9cc3c9000177f
3
+ size 5360347224
model-00016-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25f73b1e9e9fde8f9588253b0c2a9884ff115ccacf4114ad37be355ce2361454
3
+ size 5359985336
model-00017-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18d47fcb369b742e775ddc25ca499858533255ec50e0e76f2405b1f3d92b7b70
3
+ size 5360347320
model-00018-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62e23e54f40709fc762c172444a5dee41e78111df151fdbe7b48d75386a36deb
3
+ size 5360347312
model-00019-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7599267bb1fc68aeb5963661fb9f85b3e997b5752b278b27389e0560052c919a
3
+ size 5360347160
model-00020-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:681e153de4a650fa6667b55f48b1ed424741ef1633b772352f5c069b3a6e0fbd
3
+ size 5359985400
model-00021-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78b0212db6f9f6eaa9fec4a317c1fe418215903c5b3dd6cc8de9700dfcbc5279
3
+ size 5360347320
model-00022-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:947ef24293fcc3c8373eb1be27c0c3a15321e182394820249150617954e43043
3
+ size 5360347296
model-00023-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a9b4276d6c19121b5bc7da52624b6f6cc84e69160dd8cea449c2d0c4c35d5ac
3
+ size 5360347112
model-00024-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c800de893450a11db9d3784fc7bd97d946ed003379c32b2e7e75e2052f538ac
3
+ size 5359985464
model-00025-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21446e1f7a06a579eacb09ea0f86f88c4d200bab1cfc46eb59276ab5c69ba147
3
+ size 5360347320
model-00026-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c35662afd872d3d83f028523a774f3bf3873b8fd2772553097bd5712a28a5c4
3
+ size 5360347232
model-00027-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a7a3615c744098411b2bafc0061a521c3348e4002f553810c0932b39485f5a2
3
+ size 5359985328
model-00028-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:778444540ff8a43a51574b81a75eba0a15aa3df1bb4308659995b8f05d4a29a4
3
+ size 5360347320
model-00029-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d908c8177c1dfe877627baf157fa86bd3c5e6d7c2eea5cd8c84f0eacb12559a4
3
+ size 5360347320
model-00030-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6df7b340183ad645f171edec945c107f4c417b2421933a99071f3f355dfe6e7c
3
+ size 5360347168
model-00031-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a658a7bec4268a3d059bae15dab8d106ec071c8f72d66410430d81eff06696ae
3
+ size 5359985392
model-00032-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f291e238a4ca7686a833566aeaacc1706b66daa81dc9aab5de35e0670651b2af
3
+ size 5360347320
model-00033-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d58b7681a194c6cf533a852c5780799df82cdb9776c5b24cb30778149645d7cb
3
+ size 5360347312
model-00034-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f9666db39fcfad212eddb74581d83d9da9a16366080cdb2fcb1d0a6797db56d
3
+ size 5360347104
model-00035-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:387257cc5daff11c898836a457b8ba3b889d31e6756e7dde5f4bb6610909573a
3
+ size 5359985456
model-00036-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db004f95e3d6970343042fa1fef65528db625b1d954fa14f7c61b797c2b9d9bb
3
+ size 5360347320
model-00037-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9a82514d38acff76b794f3e6514766d202b7078129b9382e6fede3037ce5457
3
+ size 5360347248
model-00038-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bc34ddb175611f2393182c2bf9f3e1207c238e52cf8c852544e83cb055a1662
3
+ size 5364851048
model-00039-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2709fa9fee5c27e8e8a4093db5eaa577e8c612e442a4691054e8aada6f19c67b
3
+ size 92274928
model-00075-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61269b6447c93de8cbcb9350251a8443aaad6e818f758855e76f0a1c1b4fdb1a
3
+ size 679492952
model-00076-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:807bf5e2cd4beaa0594d692cb8939a5be25a404cdb188c23e9697791115b1e77
3
+ size 5360347104
model-00077-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:316499d677b61f3748fe237624c07ca84342fd79b84beb8dc7fe4ac64b2918c0
3
+ size 5360347104
model-00078-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b7faf14ea9f2eebd31f1c600031adece58e82e42cec6ad1ef57cc9a80ae4133
3
+ size 5360346968
model-00079-of-00282.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d52dfd2e3d0e8c8a09c682bded9597256640f2c27549ff8b2d1b5f727df7034f
3
+ size 2994373544