GGUF
imatrix
conversational
woodchen7 commited on
Commit
b49a051
·
verified ·
1 Parent(s): ed92a25

Upload README_CN.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README_CN.md +294 -0
README_CN.md ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="left">
2
+ <a href="README.md">English</a>&nbsp;|&nbsp;中文
3
+ </p>
4
+ <br>
5
+
6
+ <p align="center">
7
+ <img src="logo-zh.png" width="400"/> <br>
8
+ </p>
9
+
10
+ <div align="center" style="line-height: 1;">
11
+
12
+
13
+ [![HuggingFace](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Tencent%20Hy-ffc107?color=ffc107&logoColor=white)](https://huggingface.co/collections/tencent/hy-mt2)
14
+ &nbsp;&nbsp;
15
+ [![ModelScope](https://img.shields.io/badge/ModelScope-Tencent%20Hy-624aff)](https://modelscope.cn/collections/Tencent-Hunyuan/Hy-MT2)
16
+
17
+ </div>
18
+
19
+ <p align="center">
20
+ 🖥️&nbsp;<a href="https://aistudio.tencent.com/llm/zh?tabIndex=0"><b>官方网站</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;
21
+ 💬&nbsp;<a href="https://github.com/Tencent-Hunyuan/Hy-MT2"><b>GitHub</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;
22
+ 🪡&nbsp;<a href="https://github.com/Tencent/AngelSlim/tree/main"><b>AngelSlim</b></a></p>
23
+
24
+
25
+ ## 模型介绍
26
+
27
+ Hy-MT2-1.8B-2Bit-GGUF由AngelSlim产出,更多技术细节可以参考 [[AngelSlim]](https://github.com/Tencent/AngelSlim)。
28
+
29
+ Hy-MT2 是一款面向真实复杂场景的“快思考”多语言翻译模型家族,涵盖 1.8B、7B 和 30B-A3B(MoE)三种体量,支持 33 种语言互译并具备强大的多语言指令遵循能力。在端侧部署上,得益于 AngelSlim 1.25-bit 极端量化,其 1.8B 模型仅需 440MB 存储空间,推理速度显著提升 1.5 倍。多维度评测表明,Hy-MT2 在通用、真实业务、专业领域及指令遵循等翻译任务中表现卓越:7B 和 30B-A3B 模型性能不仅超越了 DeepSeek-V4-Pro、Kimi K2.6 等开源模型在快思考模式下的表现,轻量级 1.8B 模型亦在整体上超越了微软和豆包等主流商业 API。
30
+
31
+ 同时,本次我们也开源了一个针对翻译指令遵循能力的评测集[IFMTBench](./IFMTBench/README_zh.md)。
32
+
33
+ 也欢迎大家使用我们发布的 Hy-MT2-Translator Skill,可以方便接入Hy-MT2系列模型完成翻译任务,下载链接[ClawHub](https://clawhub.ai/tencent-adm/hy-mt2-translator-skill)和[SkillHub](https://skillhub.cn/skills/hy-mt2-translator)。
34
+
35
+ 现在,腾讯混元也在与WMT26官方合作「视频字幕翻译比赛」(https://www2.statmt.org/wmt26/video-subtitle-translation.html ),使用Hy-MT系列模型参与「通用机器翻译比赛」(https://www2.statmt.org/wmt26/translation-task.html )和「视频字幕翻译比赛」有机会获得混元特设奖励,诚邀邀大家参与,共同推动机器翻译前沿技术发展。
36
+
37
+ ## 新闻
38
+
39
+ * 2026.5.21 我们在HuggingFace和ModelScope上开源了 **Hy-MT2-1.8B**/**Hy-MT2-7B**/**Hy-MT2-30B-A3B**/**IFMTBench**
40
+ * 2025.12.30 我们在HuggingFace和ModelScope开源了 **HY-MT1.5-1.8B**和**HY-MT1.5-7B**
41
+ * 2025.9.1 我们在HuggingFace和ModelScope开源了 **Hunyuan-MT-7B**和**Hunyuan-MT-Chimera-7B**。
42
+
43
+
44
+ ## 效果
45
+ <div align='center'>
46
+ <img src="main_result.png" width = "100%" />
47
+ </div>
48
+
49
+ 更多的实验效果和分析可以参考我们的[报告](./HY_MT2_0_Report.pdf)。
50
+
51
+ &nbsp;
52
+
53
+ ## 模型链接
54
+ | 模型名 | 简介 | 下载链接 |
55
+ | ----------- | ----------- |-----------
56
+ | Hy-MT2-1.8B | 混元1.8B翻译模型 |🤗 [Model](https://huggingface.co/tencent/Hy-MT2-1.8B)|
57
+ | Hy-MT2-1.8B-FP8 | 混元1.8B翻译模型,fp8量化 | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-1.8B-FP8)|
58
+ | Hy-MT2-1.8B-GGUF | 混元1.8B翻译模型, llama.cpp | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-1.8B-GGUF)|
59
+ | Hy-MT2-1.8B-2bit-GGUF | 混元1.8B翻译模型, llama.cpp, 2bit | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-1.8B-2bit-GGUF)|
60
+ | Hy-MT2-1.8B-1.25bit-GGUF | 混元1.8B翻译模型, llama.cpp, 1.25bit | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-1.8B-1.25bit-GGUF)|
61
+ | Hy-MT2-7B | 混元7B翻译模型 | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-7B)|
62
+ | Hy-MT2-7B-FP8 | 混元7B翻译模型,fp8量化 | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-7B-FP8)|
63
+ | Hy-MT2-7B-GGUF | 混元7B翻译模型, llama.cpp | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-7B-GGUF)|
64
+ | Hy-MT2-30B-A3B | 混元30B-A3B翻译模型 | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-30B-A3B)|
65
+ | Hy-MT2-30B-A3B-FP8 | 混元30B-A3B翻译模型,fp8量化 | 🤗 [Model](https://huggingface.co/tencent/Hy-MT2-30B-A3B-FP8)|
66
+
67
+
68
+
69
+ ## Hy-MT2 翻译任务指令示例(中英文对照)
70
+
71
+ *注意:下面的source_lang和target_lang都使用语言的全称,中文使用中文全称,英文使用英文全称。*
72
+
73
+ | Type | Chinese prompt | English prompt |
74
+ |---|---|---|
75
+ | **Default Translation** | 将以下文本翻译为 `{target_lang}`,注意**只需要输出翻译后的结果,不要额外解释**:<br><br>`{source_text}` | Translate the following text into `{target_lang}`. Note that you should **only output the translated result without any additional explanation**:<br><br>`{source_text}` |
76
+ | **Terminology** | *参考下面的翻译:*<br>`{text}` 翻译成 `{text}`<br>`{text}` 翻译成 `{text}`<br>`{text}` 翻译成 `{text}`<br>将以下文本翻译为 `{target_lang}`,注意**只需要输出翻译后的结果,不要额外解释**:<br><br>`{source_text}` | *Reference the following translations:*<br>`{text}` translates to `{text}`<br>`{text}` translates to `{text}`<br>`{text}` translates to `{text}`<br><br>Translate the following text into `{target_lang}`. Note that you must **ONLY output the translated result without any additional explanation**:<br><br>`{source_text}` |
77
+ | **Style** | 请将以下文本翻译为 `{target_lang}`。<br>注意翻译的风格要严格符合【**`{target_style}`**】<br><br>`{source_text}` | Please translate the following text into `{target_lang}`. Note that the translation style must strictly conform to [**`{target_style}`**]:<br><br>`{source_text}` |
78
+ | **Personalization** | *【待翻译文本】*<br>`{source_text}`<br><br>*【翻译任务】*<br>1、**`{user_preferences}`**<br>2、**`{user_preferences}`**<br>3、……<br>4、将【待翻译文本】翻译为 `{target_lang}`。 | *[Source Text]*<br>`{source_text}`<br><br>*[Translation Tasks]*<br>1. **`{user_preferences}`**<br>2. **`{user_preferences}`**<br>3. ...<br>4. Translate the [Source Text] into `{target_lang}`. |
79
+ | **Delimiters** | 请将以下文本准确翻译为 `{target_lang}`。<br>你必须在译文中**保留等量的分隔符,绝对不可遗漏、转义或翻译该符号,并注意分隔符的位置**。<br><br>`{source_text}` | Please accurately translate the following text into `{target_lang}`.<br>You must **retain the exact same number of delimiters in the translation. Strictly do not omit, escape, or translate these symbols, and pay close attention to their placement**.<br><br>`{source_text}` |
80
+ | **Structured Data 1** | *# 任务目标*<br>将下方 `{source_text}` 中的 `{format_type}` 格式数据翻译为 `{target_lang}`。<br><br>*# 严格约束*<br>1. **结构锁定**:绝对保持原有的 `{format_type}` 数据结构、缩进和层级完全不变。<br>2. **选择性翻译**:仅翻译面向用户展示的可见文本内容。<br>3. **禁止修改**:**严禁**翻译或更改任何代码标签、键名 (Key)、变量占位符(如 `{{var}}`、`${var}`、`%s`、`%d` 等)或代码属性。<br><br>*# 数据输入*<br>`{source_text}` | *### Task*<br>Translate the user-facing text within the following `{format_type}` data into `{target_lang}`.<br><br>*### Strict Rules*<br>1. **Structure Preservation:** You MUST preserve the original `{format_type}` data structure, nesting, hierarchy, and indentation exactly as they are.<br>2. **Selective Translation:** Translate ONLY the visible, user-facing text content/values.<br>3. **Strict Non-Translation:** NEVER translate or alter code tags, keys, properties, object names, or variable placeholders. Leave them exactly in their original English/code form.<br><br>*### Source Data*<br>`{source_text}` |
81
+ | **Structured Data 2** | *【背景信息】*<br>`{background_text}`<br><br>请结合背景信息将以下文本翻译为 `{target_lang}`。<br><br>*【待翻译文本】*<br>`{source_text}` | *[Background Information]*<br>`{background_text}`<br><br>Please translate the following text into `{target_lang}`, taking the provided background information into consideration.<br><br>*[Source Text]*<br>`{source_text}` |
82
+
83
+ ---
84
+
85
+ ## 推理和部署
86
+ ### transformers
87
+
88
+ transformers>=5.6.0
89
+
90
+ ```python
91
+ from transformers import AutoModelForCausalLM, AutoTokenizer
92
+ import torch
93
+
94
+ model_path = "tencent/Hy-MT2-30B-A3B"
95
+
96
+ # Load tokenizer
97
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
98
+
99
+ # Load model
100
+ model = AutoModelForCausalLM.from_pretrained(
101
+ model_path,
102
+ dtype=torch.bfloat16,
103
+ device_map="auto",
104
+ trust_remote_code=True,
105
+ )
106
+
107
+ model.eval()
108
+
109
+ # Example inference
110
+ prompt = "将以下文本翻译成英语,注意只需要输出翻译后的结果,不要额外解释:\n\n今天天气真好。"
111
+ messages = [{"role": "user", "content": prompt}]
112
+ inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
113
+
114
+ with torch.no_grad():
115
+ outputs = model.generate(
116
+ **inputs,
117
+ max_new_tokens=4096,
118
+ )
119
+ response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
120
+ print(response)
121
+ ```
122
+
123
+ ### vllm
124
+
125
+ Build vLLM from source:
126
+ ```bash
127
+ uv venv --python 3.12 --seed --managed-python
128
+ source .venv/bin/activate
129
+ git clone https://github.com/vllm-project/vllm.git
130
+ cd vllm
131
+ uv pip install --editable . --torch-backend=auto
132
+ ```
133
+
134
+ Start the vLLM server:
135
+
136
+ ```bash
137
+ vllm serve tencent/Hy-MT2-30B-A3B --tensor-parallel-size 1
138
+ ```
139
+
140
+ ### sglang
141
+
142
+ Build SGLang from source:
143
+ ```bash
144
+ git clone https://github.com/sgl-project/sglang
145
+ cd sglang
146
+ pip3 install pip --upgrade
147
+ pip3 install "transformers>=5.6.0"
148
+ pip3 install -e "python"
149
+ ```
150
+
151
+ Launch SGLang server:
152
+
153
+ ```bash
154
+ python3 -m sglang.launch_server --model tencent/Hy-MT2-30B-A3B --tp 1
155
+ ```
156
+
157
+
158
+ ### llama_cpp
159
+ **❕❕ This gguf depends on our STQ kernel, which is released at [PR #19357](https://github.com/ggml-org/llama.cpp/pull/19357).**
160
+
161
+ #### Clone llama.cpp
162
+
163
+ ```bash
164
+ git clone https://github.com/ggml-org/llama.cpp.git
165
+ ```
166
+
167
+ #### Enter the llama.cpp folder
168
+
169
+ ```bash
170
+ cd llama.cpp
171
+ ```
172
+
173
+ #### Build llama.cpp
174
+
175
+ ```bash
176
+ cmake -B build
177
+ cmake --build build --config Release
178
+ ```
179
+
180
+ #### Run a completion example
181
+
182
+ ```bash
183
+ ./build/bin/llama-completion \
184
+ --model model.gguf \
185
+ -p "Translate the following segment into Chinese, without additional explanation:Hello" \
186
+ --jinja \
187
+ -ngl 0 \
188
+ -n 64 -st
189
+ ```
190
+
191
+ #### Run the llama.cpp benchmark
192
+
193
+ ```bash
194
+ ./build/bin/llama-bench -m model_zoo/model.gguf -ngl 0
195
+ ```
196
+
197
+
198
+ 对于1.8B和7B,我们推荐使用下面这组参数进行推理。注意,我们的模型没有默认 system_prompt。
199
+
200
+ ```json
201
+
202
+ {
203
+ "temperature": 0.7,
204
+ "top_p": 0.6,
205
+ "top_k": 20,
206
+ "repetition_penalty": 1.05,
207
+ "max_tokens": 4096
208
+ }
209
+ ```
210
+
211
+ 对于30B-A3B,我们推荐使用下面这组参数进行推理。注意,我们的模型没有默认 system_prompt。
212
+
213
+ ```json
214
+
215
+ {
216
+ "temperature": 0.7,
217
+ "top_p": 1.0,
218
+ "top_k": -1,
219
+ "repetition_penalty": 1.0,
220
+ "max_tokens": 4096
221
+ }
222
+ ```
223
+
224
+
225
+ ## 模型训练
226
+ Hy-MT2提供了完整的模型训练流程,支持全量微调和 LoRA 微调,同时支持 DeepSpeed ZeRO 多种配置以及 LLaMA-Factory 集成。
227
+
228
+ 详细的训练文档请参考:[模型训练指南](./train/README_CN.md)
229
+
230
+ ## 量化工具
231
+
232
+ 我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim)——一套易用、全面、高效的大模型压缩工具包,涵盖常用量化算法、低比特量化和投机采样等能力。
233
+
234
+
235
+ ## 支持的语种
236
+ | Languages | Abbr. | Chinese Names |
237
+ |-------------------|---------|-----------------|
238
+ | Chinese | zh | 中文 |
239
+ | English | en | 英语 |
240
+ | French | fr | 法语 |
241
+ | Portuguese | pt | 葡萄牙语 |
242
+ | Spanish | es | 西班牙语 |
243
+ | Japanese | ja | 日语 |
244
+ | Turkish | tr | 土耳其语 |
245
+ | Russian | ru | 俄语 |
246
+ | Arabic | ar | 阿拉伯语 |
247
+ | Korean | ko | 韩语 |
248
+ | Thai | th | 泰语 |
249
+ | Italian | it | 意大利语 |
250
+ | German | de | 德语 |
251
+ | Vietnamese | vi | 越南语 |
252
+ | Malay | ms | 马来语 |
253
+ | Indonesian | id | 印尼语 |
254
+ | Filipino | tl | 菲律宾语 |
255
+ | Hindi | hi | 印地语 |
256
+ | Traditional Chinese | zh-Hant| 繁体中文 |
257
+ | Polish | pl | 波兰语 |
258
+ | Czech | cs | 捷克语 |
259
+ | Dutch | nl | 荷兰语 |
260
+ | Khmer | km | 高棉语 |
261
+ | Burmese | my | 缅甸语 |
262
+ | Persian | fa | 波斯语 |
263
+ | Gujarati | gu | 古吉拉特语 |
264
+ | Urdu | ur | 乌尔都语 |
265
+ | Telugu | te | 泰卢固语 |
266
+ | Marathi | mr | 马拉地语 |
267
+ | Hebrew | he | 希伯来语 |
268
+ | Bengali | bn | 孟加拉语 |
269
+ | Tamil | ta | 泰米尔语 |
270
+ | Ukrainian | uk | 乌克兰语 |
271
+ | Tibetan | bo | 藏语 |
272
+ | Kazakh | kk | 哈萨克语 |
273
+ | Mongolian | mn | 蒙古语 |
274
+ | Uyghur | ug | 维吾尔语 |
275
+ | Cantonese | yue | 粤语 |
276
+
277
+
278
+
279
+ ## Citing Hy-MT2
280
+
281
+ ```bibtex
282
+ @misc{hy-mt1.5,
283
+ title={HY-MT1.5 Technical Report},
284
+ author={Mao Zheng and Zheng Li and Tao Chen and Mingyang Song and Di Wang},
285
+ year={2025},
286
+ eprint={2512.24092},
287
+ archivePrefix={arXiv},
288
+ primaryClass={cs.CL},
289
+ url={https://arxiv.org/abs/2512.24092},
290
+ }
291
+ ```
292
+
293
+ ## 联系我们
294
+ 如果你想给我们的研发和产品团队留言,欢迎联系我们腾讯混元LLM团队。你可以通过邮件(hunyuan_opensource@tencent.com)联系我们。