Hy-MT2-1.8B
Overview
Translate among Chinese, English, French, German, Spanish, Arabic, Japanese, Korean and Thai on compatible Qualcomm devices. Based on Hy-MT2-1.8B.
Demo recording: reserved for a post-release recording.
The model files use the AIDEM format and are loaded by the matching SDK in the Demo repository. The device needs Aidlux LMS (sudo lms check returns true); no separate QNN installation is required.
Download
First follow Install. Then, from the Demo root, download the shared files and one device target. The commands below use QCS8625; for another device, use the folder in the table below.
For a private model, run hf auth login first.
hf download APLUX-Pandora/Hy-MT2-1.8B --local-dir models --exclude "targets/*" --exclude "media/*" --exclude README.md --exclude .gitattributes
hf download APLUX-Pandora/Hy-MT2-1.8B --local-dir models --include "targets/qcs8625_qnn248/*"
Verify the downloaded target:
python demo/prepare_models.py models
| SoC | Target folder |
|---|---|
| QCS8550 | qcs8550_qnn248 |
| QCS9075 / IQ9 | qcs9075_qnn248 |
| QCS8625 | qcs8625_qnn248 |
| QCS8275 / IQ8 | qcs8275_qnn248 |
Demo and Python Usage
Complete Install and the download above, then follow Run the Web Demo. For Python, in the same environment:
Chinese-related translation — use this template when either language is Chinese.
Fill target_language with a Chinese name from the language table, such as 英语.
The examples explicitly pass this Demo's translation preset. Omitted sampling options use the loaded model package defaults. The SDK defaults to a 256-token output limit. The Demo uses an explicit 4096-token ceiling to preserve its EOS/context-bounded behavior; the total context and input limits still apply.
from pandora_hy_mt2_1_8b import LanguageModel
target_language = "英语"
source_text = "会议明天上午九点半开始,请提前十分钟到达。"
prompt = (
f"将以下文本翻译为{target_language},"
f"注意只需要输出翻译后的结果,不要额外解释:\n\n{source_text}"
)
messages = [{"role": "user", "content": prompt}]
with LanguageModel.from_pretrained("models") as model:
result = model.generate(
messages,
max_new_tokens=4096,
do_sample=True,
temperature=0.7,
top_p=0.6,
top_k=20,
repetition_penalty=1.05,
)
print(result.text)
Translation between non-Chinese languages — use the English template.
Fill target_language with an English name from the language table, such as French.
from pandora_hy_mt2_1_8b import LanguageModel
target_language = "French"
source_text = "The meeting starts at nine thirty tomorrow morning. Please arrive ten minutes early."
prompt = (
f"Translate the following text into {target_language}. "
"Note that you should only output the translated result "
f"without any additional explanation:\n\n{source_text}"
)
messages = [{"role": "user", "content": prompt}]
with LanguageModel.from_pretrained("models") as model:
result = model.generate(
messages,
max_new_tokens=4096,
do_sample=True,
temperature=0.7,
top_p=0.6,
top_k=20,
repetition_penalty=1.05,
)
print(result.text)
License
The model resources retain their Apache-2.0 terms. See NOTICE and LICENSES. The Demo repository documents the SDK and supplier runtime terms.