Downloads · 30 days
42
30% of all-time downloads
assassindesign/Hy-MT2-1.8B-MLX-4bit
Hy-MT2-1.8B-MLX-4bit is a translation model from assassindesign. Use it when you need text moved from one language to another. It is set up for mlx. The card lists the license as other.
这是腾讯混元翻译模型 tencent/Hy-MT2-1.8B 的 Apple MLX 4-bit 量化版本,用于在 Apple Silicon(Mac / iPhone / iPad)上本地、离线运行。
Downloads · 30 days
42
30% of all-time downloads
All-time downloads
140
Public
Parameters
1.8B
1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1 GB · 99%
How the weights are stored.
U321.8B · 100%
From the Hugging Face model README
这是腾讯混元翻译模型 tencent/Hy-MT2-1.8B 的 Apple MLX 4-bit 量化版本,用于在 Apple Silicon(Mac / iPhone / iPad)上本地、离线运行。
本仓库仅做格式转换 + 权重量化,未改变模型能力。所有翻译能力、支持语言、版权与许可均继承自原始模型。
| 项目 | 值 |
|---|---|
| 基础模型 | tencent/Hy-MT2-1.8B |
| 架构 | hunyuan_v1_dense(HunYuanDenseV1ForCausalLM) |
| 参数量 | 1.8B |
| 量化 | 4-bit,affine,group_size 64(约 4.5 bits/weight) |
| 体积 | 约 970 MB |
| 层数 / 隐藏维度 | 32 / 2048 |
| 注意力头 | 16(KV 头 4,GQA)/ head_dim 128 |
| 词表 | 120818 |
| 特性 | QK-Norm、Dynamic-NTK RoPE、tied embeddings |
| 支持语言 | 33 种语言互译(中英为主) |
pip install -U mlx-lm
mlx_lm.convert \
--hf-path tencent/Hy-MT2-1.8B \
-q --q-bits 4 \
--mlx-path Hy-MT2-1.8B-MLX-4bit
pip install -U mlx-lm
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("<your-username>/Hy-MT2-1.8B-MLX-4bit")
# 混元 MT 无 system prompt,用显式方向指令,模型只输出译文
instruction = "将下面的英文翻译成中文。只输出中文译文,不要输出其它语言,不要解释。\n\nHello, nice to meet you."
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": instruction}],
tokenize=False, add_generation_prompt=True,
)
sampler = make_sampler(temp=0.7, top_p=0.6)
text = generate(model, tokenizer, prompt=prompt, max_tokens=256, sampler=sampler, verbose=True)
print(text) # 你好,很高兴认识你。
mlx_lm.generate --model <your-username>/Hy-MT2-1.8B-MLX-4bit \
--prompt "将下面的中文翻译成英文。只输出英文译文,不要解释。\n\n很高兴认识你。" \
--temp 0.7 --top-p 0.6 --max-tokens 256
⚠️ 截至 mlx-swift-lm 3.31.x,Swift 端尚未内置 hunyuan_v1_dense 架构,
直接加载会报 unsupported model type。需在工程内自行实现并注册该架构。
移植时注意两点:RoPE 为 Dynamic-NTK(base = rope_theta * alpha^(head_dim/(head_dim-2)))、
QK-Norm 在 RoPE 之后(与 Qwen3 相反)。
官方推荐(1.8B / 7B):temperature 0.7,top_p 0.6,top_k 20,repetition_penalty 1.05。
混元 MT 无默认 system prompt。中英互译建议用显式方向约束,避免短句跑偏到第三语言:
将下面的<源语言>翻译成<目标语言>。只输出<目标语言>译文,不要输出其它语言,不要解释。
<原文>
4-bit 量化会带来轻微质量损失,但对中英日常翻译影响很小,实测短句/常用句翻译准确、干净。 追求最高质量可用原始 bf16 模型或更高位量化(如 8-bit)。
本模型遵循 腾讯混元社区许可协议(Tencent Hunyuan Community License Agreement),
与原始模型 tencent/Hy-MT2-1.8B 一致。使用前请阅读随附的 LICENSE.txt。
关键条款(摘要,以原文为准):
LICENSE.txt 与 Notice 声明;