本仓库提供该官方 T5 权重的 Ascend910 推理适配。推理仅在 npu:0 执行,模型参数、输入张量和输出 logits 均不回退到 CPU。
9347932a0f57dd8bd5f9c636d31d5b0e0cba9f3823a19d74ab8ce11e80e25fc7[1, 1, 32868]shared.weight 与 encoder、decoder、lm head 三个共享别名已验证为同一参数存储。将官方仓库文件下载到 MODEL_DIR(默认当前目录的 official_model),然后运行:
pip install -r requirements.txt
MODEL_DIR=/path/to/official_model python inference.pyinference.py 会在加载后验证全部 state-dict 键;仅 T5 官方共享 embedding 的三个别名可由 shared.weight 覆盖。其他缺失、多余或不匹配键均会失败。