trohrbaugh commited on
Commit
26774a5
·
verified ·
1 Parent(s): aaae574

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +194 -127
README.md CHANGED
@@ -1,199 +1,266 @@
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
+ license: apache-2.0
3
  library_name: transformers
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - hunyuan
7
+ - hy3
8
+ - moe
9
+ - text-generation
10
+ - heretic
11
+ - uncensored
12
+ - decensored
13
+ - abliterated
14
  ---
15
+ # This is a decensored version of a model, made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0+custom
16
 
17
+ ## Abliteration parameters
18
 
19
+ | Parameter | Value |
20
+ | :-------- | :---: |
21
+ | **direction_index** | 36.95 |
22
+ | **attn.o_proj.max_weight** | 2.72 |
23
+ | **attn.o_proj.max_weight_position** | 62.94 |
24
+ | **attn.o_proj.min_weight** | 2.44 |
25
+ | **attn.o_proj.min_weight_distance** | 60.89 |
26
+ | **mlp.down_proj.max_weight** | 1.47 |
27
+ | **mlp.down_proj.max_weight_position** | 67.79 |
28
+ | **mlp.down_proj.min_weight** | 0.54 |
29
+ | **mlp.down_proj.min_weight_distance** | 31.09 |
30
 
31
+ ## Performance
32
 
33
+ | Metric | This model | Original model (a model) |
34
+ | :----- | :--------: | :---------------------------: |
35
+ | **KL divergence** | 0.2398 | 0 *(by definition)* |
36
+ | **Refusals** | 1/100 | 99/100 |
37
 
38
+ -----
39
 
40
+ <p align="left">
41
+ <a href="https://huggingface.co/tencent/Hy3/blob/main/README_CN.md">中文</a>&nbsp;|&nbsp;English
42
+ </p>
43
+ <br>
44
 
45
+ <p align="center">
46
+ <img src="assets/logo-en.png" width="400"/> <br>
47
+ </p>
48
 
49
+ <div align="center" style="line-height: 1;">
50
 
 
 
 
 
 
 
 
51
 
52
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](#license)
53
+ &nbsp;&nbsp;
54
+ [![HuggingFace](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Tencent%20Hy-ffc107?color=ffc107&logoColor=white)](https://huggingface.co/tencent/Hy3)
55
+ &nbsp;&nbsp;
56
+ [![ModelScope](https://img.shields.io/badge/ModelScope-Tencent%20Hy-624aff)](https://modelscope.cn/models/Tencent-Hunyuan/Hy3)
57
+ &nbsp;&nbsp;
58
+ [![cnb.cool](https://img.shields.io/badge/cnb.cool-Tencent%20Hy-blue?logoColor=white)](https://cnb.cool/ai-models/tencent/Hy3)
59
+ &nbsp;&nbsp;
60
+ [![GitCode](https://img.shields.io/badge/GitCode-Tencent%20Hy-red?logoColor=white)](https://ai.gitcode.com/tencent_hunyuan/Hy3)
61
 
62
+ </div>
63
 
64
+ <p align="center">
65
+ 🖥️&nbsp;<a href="https://aistudio.tencent.com/"><b>Official Website</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;
66
+ 💬&nbsp;<a href="https://github.com/Tencent-Hunyuan/Hy3"><b>GitHub</b></a></p>
67
 
68
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
+ ## Table of Contents
71
+
72
+ - [Model Introduction](#model-introduction)
73
+ - [Stronger Agent Capabilities](#stronger-agent-capabilities)
74
+ - [More Reliable Product Experiences](#more-reliable-product-experiences)
75
+ - [Benchmark Appendix](#benchmark-appendix)
76
+ - [News](#news)
77
+ - [Model Links](#model-links)
78
+ - [Quickstart](#quickstart)
79
+ - [Deployment](#deployment)
80
+ - [vLLM](#vllm)
81
+ - [SGLang](#sglang)
82
+ - [Finetuning](#finetuning)
83
+ - [Quantization](#quantization)
84
+ - [License](#license)
85
+ - [Contact Us](#contact-us)
86
 
87
+ ---
88
 
89
+ ## Model Introduction
90
 
91
+ **Hy3** is a 295B-parameter Mixture-of-Experts (MoE) model with 21B active parameters and 3.8B MTP layer parameters, developed by the Tencent Hy Team. Following the Hy3 Preview launch in late April, we gathered feedback from 50+ products and scaled up post-training with higher quality data. Today, we introduce Hy3, which outperforms similar-size models and rivals flagship open-source models with 2-5x parameters. It also shows significant gains in utility across various products and productivity tasks.
92
 
 
93
 
94
+ | Property | Value |
95
+ |:---|:---|
96
+ | Architecture | Mixture-of-Experts (MoE) |
97
+ | Total Parameters | 295B |
98
+ | Activated Parameters | 21B |
99
+ | MTP Layer Parameters | 3.8B |
100
+ | Number of Layers (excluding MTP layer) | 80 |
101
+ | Number of MTP Layers | 1 |
102
+ | Attention Heads | 64 (GQA, 8 KV heads, head dim 128) |
103
+ | Hidden Size | 4096 |
104
+ | Intermediate Size | 13312 |
105
+ | Context Length | 256K |
106
+ | Vocabulary Size | 120832 |
107
+ | Number of Experts | 192 experts, top-8 activated |
108
+ | Supported Precisions | BF16 |
109
 
110
+ ## Stronger Agent Capabilities
111
 
112
+ Building on Hy3 Preview, we further improved the quality and diversity of post-training data while scaling up RL training. Hy3 shows solid gains across reasoning, agentic, and long-context tasks, competitive with much larger flagship models.
113
 
114
+ <p align="center">
115
+ <img src="assets/benchmark.png" width="100%"/>
116
+ </p>
117
 
118
+ In productivity scenarios such as coding, office work, financial modeling, frontend design, and game development, Hy3 has made remarkable progress and can now serve as a reliable, cost-effective model option.
119
 
120
+ We don't think public benchmark scores tell the full story. So we ran a blind evaluation with 270 experts using tasks from their work, and Hy3 scored 2.67/4, outperforming GLM-5.1 at 2.51/4. The advantage was most substantial in frontend development, data & storage, and CI/CD tasks.
121
 
122
+ ## More Reliable Product Experiences
123
 
124
+ Model usefulness is not fully captured by benchmarks. Based on extensive product feedback, we identified and fixed the following issues, receiving consistently positive feedback from product teams.
125
 
126
+ **Stability of tool calls and output formats**: We fixed multiple baseline reliability issues, bringing the model to production-grade standards across tool configurations and output constraints. Tool-call error recovery and overall efficiency improved. Hy3 also generalizes across different agent scaffoldings. On SWE-Bench Verified, accuracy variance across scaffoldings like CodeBuddy, Cline, and KiloCode remains within 4%.
127
 
128
+ **Knowledge and anti-hallucination**: Guided by the ideal of "answer when grounded, state when evidence is missing, do not conflate sources or fabricate data," we implemented fine-grained data cleaning and training constraints. In internal evaluations based on real-world scenarios, Hy3's hallucination rate dropped from 12.5% to 5.4%, and commonsense error rates fell from 25.4% to 12.7%. These improvements materially reduce fact conflation, fabrication, and logical contradiction.
129
 
130
+ **Complex context retention and multi-turn intent tracking**: Through joint optimization of SFT and RL, Hy3 improved on operational pain points like coreference resolution, ellipsis recovery, and multi-turn constraint inheritance. On internal comprehensive multi-turn tests, the issue rate dropped from 17.4% to 7.9%. Hy3 also improved markedly on long-dialogue evals like MRCR. Its outputs are more concise while ensuring complex intents do not decay or drift over long-horizon interactions.
131
 
132
+ ## Benchmark Appendix
133
 
134
+ <p align="center">
135
+ <img src="assets/benchmark-appendix.png" width="100%"/>
136
+ </p>
137
 
138
+ ## News
139
 
 
140
 
141
+ * 🔥 We open-source **Hy3** and **Hy3-FP8** model weights on [Hugging Face](https://huggingface.co/tencent/Hy3), [ModelScope](https://modelscope.cn/models/Tencent-Hunyuan/Hy3), [GitCode](https://ai.gitcode.com/tencent_hunyuan/Hy3), and [CNB](https://cnb.cool/ai-models/tencent/Hy3).
142
 
143
+ ## Model Links
144
 
 
145
 
146
+ | Model Name | Description | Hugging Face | ModelScope | GitCode | CNB |
147
+ |:---|:---|:---:|:---:|:---:|:---:|
148
+ | Hy3 | Instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3) | [Model](https://cnb.cool/ai-models/tencent/Hy3) |
149
+ | Hy3-FP8 | FP8 quantized instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3-FP8) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3-FP8) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3-FP8) | [Model](https://cnb.cool/ai-models/tencent/Hy3-FP8) |
150
 
151
+ ## Quickstart
152
 
153
+ Deploy Hy3 with [vLLM](#vllm) or [SGLang](#sglang) first, then call the OpenAI-compatible API:
154
 
155
+ ```python
156
+ from openai import OpenAI
157
 
158
+ client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
159
 
160
+ response = client.chat.completions.create(
161
+ model="hy3",
162
+ messages=[
163
+ {"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
164
+ ],
165
+ temperature=0.9,
166
+ top_p=1.0,
167
+ # reasoning_effort: "no_think" (default, direct response), "low", "high" (deep chain-of-thought)
168
+ extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
169
+ )
170
+ print(response.choices[0].message.content)
171
+ ```
172
 
173
+ > **Recommended parameters**: `temperature=0.9`, `top_p=1.0`.
174
+ >
175
+ > **Reasoning mode**: Set `reasoning_effort` to `"high"` for complex tasks (math, coding, reasoning) or `"no_think"` for direct responses.
176
 
177
+ See the [Deployment](#deployment) section below for how to start the API server.
178
 
179
+ ## Deployment
 
 
 
 
180
 
181
+ Hy3 has 295B parameters in total. To serve it on 8 GPUs, we recommend using H20-3e or other GPUs with larger memory capacity.
182
 
183
+ For production serving, we recommend using vLLM or SGLang, both of which provide dedicated recipes for Hy3:
184
 
185
+ - [vLLM](https://github.com/vllm-project/vllm) - see [vLLM recipes](https://recipes.vllm.ai/tencent/Hy3)
186
 
187
+ - [SGLang](https://docs.sglang.io/) - see [SGLang cookbook](https://lmsysorg.mintlify.app/cookbook/autoregressive/Tencent/Hy3)
188
 
189
+ ### vLLM
190
 
191
+ Build vLLM from source:
192
+ ```bash
193
+ uv venv --python 3.12 --seed --managed-python
194
+ source .venv/bin/activate
195
+ git clone https://github.com/vllm-project/vllm.git
196
+ cd vllm
197
+ uv pip install --editable . --torch-backend=auto
198
+ ```
199
 
200
+ Start the vLLM server with MTP enabled:
201
 
202
+ ```bash
203
+ # Switch to trtllm backend to work-around mnnvl workspace size issue.
204
+ export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
205
+ vllm serve tencent/Hy3 \
206
+ --tensor-parallel-size 8 \
207
+ --speculative-config.method mtp \
208
+ --speculative-config.num_speculative_tokens 2 \
209
+ --tool-call-parser hy_v3 \
210
+ --reasoning-parser hy_v3 \
211
+ --enable-auto-tool-choice \
212
+ --port 8000 \
213
+ --served-model-name hy3
214
+ ```
215
 
216
+ ### SGLang
217
 
218
+ Build SGLang from source:
219
+ ```bash
220
+ git clone https://github.com/sgl-project/sglang
221
+ cd sglang
222
+ pip3 install pip --upgrade
223
+ pip3 install "transformers>=5.6.0"
224
+ pip3 install -e "python"
225
+ ```
226
 
227
+ Launch SGLang server with MTP enabled:
228
 
229
+ ```bash
230
+ python3 -m sglang.launch_server \
231
+ --model tencent/Hy3 \
232
+ --tp-size 8 \
233
+ --tool-call-parser hunyuan \
234
+ --reasoning-parser hunyuan \
235
+ --speculative-num-steps 2 \
236
+ --speculative-eagle-topk 1 \
237
+ --speculative-num-draft-tokens 3 \
238
+ --speculative-algorithm EAGLE \
239
+ --port 8000 \
240
+ --served-model-name hy3
241
+ ```
242
 
243
+ ## Finetuning
244
 
245
+ Hy3 provides a complete model finetuning pipeline. For detailed documentation, please refer to: [Finetuning Guide](https://huggingface.co/tencent/Hy3/blob/main/finetune/README.md)
246
 
247
+ ## Quantization
248
 
249
+ We provide [AngelSlim](https://github.com/tencent/AngelSlim), a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
250
 
251
+ ## License
252
 
 
253
 
254
+ Hy3 is released under the **Apache License 2.0**. See [LICENSE](https://huggingface.co/tencent/Hy3/blob/main/LICENSE) for details.
255
 
256
+ ## Contact Us
257
 
258
+ If you would like to leave a message for our R&D and product teams, welcome to contact us. You can also reach us via email:
259
 
260
+ 📧 **hunyuan_opensource@tencent.com**
261
 
262
+ ---
263
 
264
+ <p align="center">
265
+ <i>Hy3 is developed by the Tencent Hy Team.</i>
266
+ </p>