Tencent-Hunyuan/Hy-MT2
GitHub: Tencent-Hunyuan/Hy-MT2
Hy-MT2 是腾讯混元推出的多语言翻译大模型系列,支持 33 种语言互译并提供从轻量端侧到大规模 MoE 的多种规格选择。
Stars: 512 | Forks: 35
English | 中文
[](https://huggingface.co/collections/tencent/hy-mt2)
[](https://modelscope.cn/collections/Tencent-Hunyuan/Hy-MT2)
🖥️ 官方网站 | 💬 GitHub | 🪡 AngelSlim | 📚 Hy-MT2 报告
## 模型介绍 Hy-MT2 是一系列专为复杂现实场景设计的“快思考”多语言翻译模型。它包含三种模型尺寸:1.8B、7B 和 30B-A3B (MoE),所有模型均支持 33 种语言之间的互译,并能有效地遵循多语言的翻译指令。 对于端侧部署,AngelSlim 1.25-bit 极限量化和推测采样将 1.8B 模型的存储需求降至仅 440 MB,并将推理速度提升了 1.5 倍。 多维度评估表明,Hy-MT2 在通用、真实业务、特定领域以及遵循指令的翻译任务中均表现出色。7B 和 30B-A3B 模型在快思考模式下超越了 DeepSeek-V4-Pro 和 Kimi K2.6 等开源模型,而轻量级的 1.8B 模型总体上也胜过微软和豆包等提供商的主流商业 API。 在本次发布中,我们还开源了 [IFMTBench](./IFMTBench/README.md),这是一个用于评估翻译指令遵循能力的基准测试。 我们也欢迎大家使用我们发布的 Hy-MT2-Translator Skill,它可以轻松集成 Hy-MT2 系列模型来执行翻译任务。下载链接:[ClawHub](https://clawhub.ai/tencent-adm/hy-mt2-translator-skill) 和 [SkillHub](https://skillhub.cn/skills/hy-mt2-translator)。 目前,腾讯 Hy 已正式与 WMT26 合作举办“视频字幕翻译任务”(https://www2.statmt.org/wmt26/video-subtitle-translation.html)。使用 Hy-MT 系列模型参加“通用机器翻译任务”(https://www2.statmt.org/wmt26/translation-task.html)和“视频字幕翻译任务”的参赛者,将有机会赢得由混元赞助的特别奖项。我们诚挚邀请大家参与,共同突破机器翻译技术的边界! ## 最新动态 * 2026.5.21 我们在 HuggingFace 和 ModelScope 上开源了 **Hy-MT2-1.8B**/**Hy-MT2-7B**/**Hy-MT2-30B-A3B**/**IFMTBench**。 * 2025.12.30 我们在 HuggingFace 和 ModelScope 上开源了 **HY-MT1.5-1.8B** 和 **HY-MT1.5-7B**。 * 2025.9.1 我们在 HuggingFace 和 ModelScope 上开源了 **Hunyuan-MT-7B** 和 **Hunyuan-MT-Chimera-7B**。 ## 评估结果
`{source_text}` | Translate the following text into `{target_lang}`. Note that you should **only output the translated result without any additional explanation**:
`{source_text}` | | **术语** | *参考下面的翻译:*
`{text}` 翻译成 `{text}`
`{text}` 翻译成 `{text}`
`{text}` 翻译成 `{text}`
将以下文本翻译为 `{target_lang}`,注意**只需要输出翻译后的结果,不要额外解释**:
`{source_text}` | *Reference the following translations:*
`{text}` translates to `{text}`
`{text}` translates to `{text}`
`{text}` translates to `{text}`
Translate the following text into `{target_lang}`. Note that you must **ONLY output the translated result without any additional explanation**:
`{source_text}` | | **风格** | 请将以下文本翻译为 `{target_lang}`。
注意翻译的风格要严格符合【**`{target_style}`**】
`{source_text}` | Please translate the following text into `{target_lang}`. Note that the translation style must strictly conform to [**`{target_style}`**]:
`{source_text}` | | **个性化** | *【待翻译文本】*
`{source_text}`
*【翻译任务】*
1、**`{user_preferences}`**
2、**`{user_preferences}`**
3、……
4、将【待翻译文本】翻译为 `{target_lang}`。 | *[Source Text]*
`{source_text}`
*[Translation Tasks]*
1. **`{user_preferences}`**
2. **`{user_preferences}`**
3. ...
4. Translate the [Source Text] into `{target_lang}`. | | **分隔符** | 请将以下文本准确翻译为 `{target_lang}`。
你必须在译文中**保留等量的分隔符,绝对不可遗漏、转义或翻译该符号,并注意分隔符的位置**。
`{source_text}` | Please accurately translate the following text into `{target_lang}`.
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**.
`{source_text}` | | **结构化数据 1** | *# 任务目标*
将下方 `{source_text}` 中的 `{format_type}` 格式数据翻译为 `{target_lang}`。
*# 严格约束*
1. **结构锁定**:绝对保持原有的 `{format_type}` 数据结构、缩进和层级完全不变。
2. **选择性翻译**:仅翻译面向用户展示的可见文本内容。
3. **禁止修改**:**严禁**翻译或更改任何代码标签、键名 (Key)、变量占位符(如 `{{var}}`、`${var}`、`%s`、`%d` 等)或代码属性。
*# 数据输入*
`{source_text}` | *### Task*
Translate the user-facing text within the following `{format_type}` data into `{target_lang}`.
*### Strict Rules*
1. **Structure Preservation:** You MUST preserve the original `{format_type}` data structure, nesting, hierarchy, and indentation exactly as they are.
2. **Selective Translation:** Translate ONLY the visible, user-facing text content/values.
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.
*### Source Data*
`{source_text}` | | **结构化数据 2** | *【背景信息】*
`{background_text}`
请结合背景信息将以下文本翻译为 `{target_lang}`。
*【待翻译文本】*
`{source_text}` | *[Background Information]*
`{background_text}`
Please translate the following text into `{target_lang}`, taking the provided background information into consideration.
*[Source Text]*
`{source_text}` | ## 推理与部署 对于 1.8B 和 7B 模型,我们推荐使用以下参数进行推理。请注意,我们的模型没有默认的 system_prompt。 ``` { "temperature": 0.7, "top_p": 0.6, "top_k": 20, "repetition_penalty": 1.05, "max_tokens": 4096 } ``` 对于 30B-A3B 模型,我们推荐使用以下参数进行推理。请注意,我们的模型没有默认的 system_prompt。 ``` { "temperature": 0.7, "top_p": 1.0, "top_k": -1, "repetition_penalty": 1.0, "max_tokens": 4096 } ``` ### transformers transformers>=5.6.0 ``` from transformers import AutoModelForCausalLM, AutoTokenizer import torch model_path = "tencent/Hy-MT2-30B-A3B" # 加载 tokenizer tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True) # 加载 model model = AutoModelForCausalLM.from_pretrained( model_path, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True, ) model.eval() # 推理示例 prompt = "将以下文本翻译成英语,注意只需要输出翻译后的结果,不要额外解释:\n\n今天天气真好。" messages = [{"role": "user", "content": prompt}] inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=4096, ) response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True) print(response) ``` ### vllm 从源码构建 vLLM: ``` uv venv --python 3.12 --seed --managed-python source .venv/bin/activate git clone https://github.com/vllm-project/vllm.git cd vllm uv pip install --editable . --torch-backend=auto ``` 启动 vLLM 服务器: ``` vllm serve tencent/Hy-MT2-30B-A3B --tensor-parallel-size 1 ``` ### sglang 从源码构建 SGLang: ``` git clone https://github.com/sgl-project/sglang cd sglang pip3 install pip --upgrade pip3 install "transformers>=5.6.0" pip3 install -e "python" ``` 启动 SGLang 服务器: ``` python3 -m sglang.launch_server --model tencent/Hy-MT2-30B-A3B --tp 1 ``` ### llama_cpp **❕❕ 此 gguf 依赖于我们的 STQ kernel,该 kernel 发布于 [PR #22836](https://github.com/ggml-org/llama.cpp/pull/22836)。** #### 克隆 llama.cpp ``` git clone https://github.com/ggml-org/llama.cpp.git ``` #### 进入 llama.cpp 文件夹 ``` cd llama.cpp ``` #### 构建 llama.cpp ``` cmake -B build cmake --build build --config Release ``` #### 运行补全示例 ``` ./build/bin/llama-completion \ --model model.gguf \ -p "Translate the following segment into Chinese, without additional explanation:Hello" \ --jinja \ -ngl 0 \ -n 64 -st ``` #### 运行 llama.cpp 基准测试 ``` ./build/bin/llama-bench -m model_zoo/model.gguf -ngl 0 ``` ## 模型训练 Hy-MT2 提供了完整的模型训练 pipeline,支持全参数微调和 LoRA 微调,以及多种 DeepSpeed ZeRO 配置和 LLaMA-Factory 集成。 有关详细的训练文档,请参考:[模型训练指南](./train/README.md) ## 量化工具 我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim),这是一个易于使用、全面且高效的大模型压缩工具包,涵盖常见的量化算法、低比特量化、推测采样等功能。 ## 支持的语言 | 语言 | 缩写 | 中文名称 | |-------------------|---------|-----------------| | Chinese | zh | 中文 | | English | en | 英语 | | French | fr | 法语 | | Portuguese | pt | 葡萄牙语 | | Spanish | es | 西班牙语 | | Japanese | ja | 日语 | | Turkish | tr | 土耳其语 | | Russian | ru | 俄语 | | Arabic | ar | 阿拉伯语 | | Korean | ko | 韩语 | | Thai | th | 泰语 | | Italian | it | 意大利语 | | German | de | 德语 | | Vietnamese | vi | 越南语 | | Malay | ms | 马来语 | | Indonesian | id | 印尼语 | | Filipino | tl | 菲律宾语 | | Hindi | hi | 印地语 | | Traditional Chinese | zh-Hant| 繁体中文 | | Polish | pl | 波兰语 | | Czech | cs | 捷克语 | | Dutch | nl | 荷兰语 | | Khmer | km | 高棉语 | | Burmese | my | 缅甸语 | | Persian | fa | 波斯语 | | Gujarati | gu | 古吉拉特语 | | Urdu | ur | 乌尔都语 | | Telugu | te | 泰卢固语 | | Marathi | mr | 马拉地语 | | Hebrew | he | 希伯来语 | | Bengali | bn | 孟加拉语 | | Tamil | ta | 泰米尔语 | | Ukrainian | uk | 乌克兰语 | | Tibetan | bo | 藏语 | | Kazakh | kk | 哈萨克语 | | Mongolian | mn | 蒙古语 | | Uyghur | ug | 维吾尔语 | | Cantonese | yue | 粤语 | ## 引用 Hy-MT2 ``` @misc{zheng2026hymt2familyfastefficient, title={Hy-MT2: A Family of Fast, Efficient and Powerful Multilingual Translation Models in the Wild}, author={Mao Zheng and Zheng Li and Tao Chen and Bo Lv and Mingrui Sun and Mingyang Song and Jinlong Song and Hong Huang and Decheng Wu and Hai Wang and Yifan Song and Yanfeng Chen and Guanwei Zhang}, year={2026}, eprint={2605.22064}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2605.22064}, } ``` ## 联系我们 如果您想为我们的研发和产品团队留下反馈,欢迎联系腾讯混元 LLM 团队。您可以通过电子邮件 hunyuan_opensource@tencent.com 联系我们。
标签:DLL 劫持, 人工智能, 凭据扫描, 多语言模型, 大语言模型, 机器翻译, 模型量化, 用户模式Hook绕过, 端侧部署, 系统调用监控, 逆向工具