模型名称: davor/ayutthayaalpha-2.0-early-beta
模型链接: HuggingFace
模型描述: T5-based multilingual seq2seq model for text-to-text generation, including Thai language processing.
模型架构: T5 Encoder-Decoder (T5ForConditionalGeneration)
参数规模: 73,468,416 (~73M)
输入规格:
输出规格:
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch-npu | >= 2.1.0 | 昇腾 NPU 后端 |
| transformers | >= 4.57.0 | HuggingFace Transformers |
| sentencepiece | >= 0.1.99 | Tokenizer 依赖 |
| protobuf | >= 3.20.0 | 模型序列化依赖 |
| numpy | < 2 | 版本兼容性 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
pip install torch>=2.1.0 torch-npu>=2.1.0 transformers>=4.57.0 sentencepiece>=0.1.99 protobuf>=3.20.0 "numpy<2"# 检查 NPU 设备
npu-smi info
# 验证 torch_npu
python3 -c "import torch_npu; print(torch.npu.device_count(), torch.npu.get_device_name(0))"# HuggingFace(推荐)
huggingface-cli download davor/ayutthayaalpha-2.0-early-beta --local-dir ./weights
# AtomGit 镜像(HuggingFace 下载慢时使用)
huggingface-cli download --repo-type model https://ai.gitcode.com/hf_mirrors/davor/ayutthayaalpha-2.0-early-beta --local-dir ./weights# 单条推理
python3 inference.py --model-path ./weights
# 批量推理(自定义参数)
python3 inference.py --model-path ./weights --max-new-tokens 64 --device 0| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model-path | str | 必填 | 模型 checkpoint 路径 |
| --max-new-tokens | int | 32 | 最大生成 token 数 |
| --device | int | 0 | NPU 设备编号 |
[模型] davor/ayutthayaalpha-2.0-early-beta
[设备] Ascend910_9362 (npu:0)
[输入] translate English to Thai: Hello, how are you?
[输出] ลิช โต ไท โฮว ฮาร์
[耗时] 1115ms
[状态] SUCCESS[基准测试] 批量推理 (3 条):
translate English to Thai: Hello, how are you?
-> ลิช โต ไท โฮว ฮาร์
[370ms]
translate English to Thai: What is your name?
-> ลิช โท อิส ยูเอน นาเม็ค เต
[525ms]
translate English to Thai: Good morning
-> ลิช โต ไท เค. (
[311ms]
平均: 404ms
最小: 311ms
最大: 525ms注意: 此模型为轻量级 T5 (60M参数),未经过专项翻译微调,输出为演示用途。推理失败时输出
[状态] FAILED。
运行命令:
python3 inference.py --model-path ./weights --max-new-tokens 32输出:
[模型] davor/ayutthayaalpha-2.0-early-beta
[设备] Ascend910_9362 (npu:0)
[输入] translate English to Thai: Hello, how are you?
[输出] ลิช โต ไท โฮว ฮาร์
[耗时] 1115ms运行命令:
python3 inference.py --model-path ./weights --max-new-tokens 32输出:
[基准测试] 批量推理 (3 条):
平均: 404ms
最小: 311ms
最大: 525ms


测试数据: 人工构造英文到泰语翻译样本(3条)
评测指标:
| 指标 | 结果 | 说明 |
|---|---|---|
| 单条推理延迟 | ~1115ms (首次) / ~370ms (缓存) | 首次推理包含模型加载时间 |
| 批量推理平均延迟 | ~404ms/条 | 3条批量推理,beam=1 |
| NPU 显存 | ~1.2GB | T5-small 级别模型 |
评测命令:
python3 inference.py --model-path ./weights --max-new-tokens 32from_pretrained(torch_dtype=...) 参数已废弃,建议使用 dtype=。