Views
No views yet
pip install -U mlx-lm1mlx_lm.generate \
2 --model mlx-community/hy-mt2-1.8b-abliterated-bf16 \
3 --prompt "将以下文本翻译成英语,注意只需要输出翻译后的结果,不要额外解释:\n\n今天天气真好。" \
4 --max-tokens 4096 \
5 --temp 0.7 \
6 --top-p 0.61from mlx_lm import load, generate
2
3model_id = "mlx-community/hy-mt2-1.8b-abliterated-bf16"
4model, tokenizer = load(model_id)
5
6prompt = "将以下文本翻译成英语,注意只需要输出翻译后的结果,不要额外解释:\n\n今天天气真好。"
7messages = [{"role": "user", "content": prompt}]
8formatted_prompt = tokenizer.apply_chat_template(
9 messages,
10 tokenize=False,
11 add_generation_prompt=True,
12)
13
14response = generate(
15 model,
16 tokenizer,
17 prompt=formatted_prompt,
18 max_tokens=4096,
19 temp=0.7,
20)
21print(response)1Translate the following text into Chinese. Only output the translated result without additional explanation:
2
3The weather is nice today.1{
2 "temperature": 0.7,
3 "top_p": 0.6,
4 "top_k": 20,
5 "repetition_penalty": 1.05,
6 "max_tokens": 4096
7}1@misc{zheng2026hymt2familyfastefficient,
2 title={Hy-MT2: A Family of Fast, Efficient and Powerful Multilingual Translation Models in the Wild},
3 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},
4 year={2026},
5 eprint={2605.22064},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2605.22064}
9}