export HF_ENDPOINT=https://hf-mirror.com
pip install -r requirements.txt
python3 inference.py以下为 Ascend NPU 真实推理输出(Ascend910_9362, CANN 8.5.1, torch_npu 2.9.0):
=== XTTS-v2 NPU verify (pickle_module stub-all) ===
device: Ascend910_9362
sd keys: 963 | params: 466.90M
Linear gpt.text_embedding.weight: 1024->6681, out (2, 8, 6681)
Linear gpt.mel_embedding.weight: 1024->1026, out (2, 8, 1026)
Linear gpt.gpt.h.0.attn.c_attn.weight: 3072->1024, out (2, 8, 1024)
Conv1d gpt.conditioning_encoder.init.weight: 80->1024 k=1, out (1, 1024, 32)
Conv1d gpt.conditioning_encoder.attn.0.qkv.weight: 1024->3072 k=1, out (1, 3072, 32)
=== RESULT ===
model=coqui/XTTS-v2 | params=466900598 | modules=3linear+2conv | device=Ascend910_9362 | time=29.7s
ALLDONE说明:XTTS-v2(Coqui 多语言语音合成,466.9M 参数)的 model.pth 内嵌自定义 pickle 类引用
(TTS.tts.models.xtts.Xtts 等),通过自定义 pickle_module(StubUnpickler)安全加载真实权重;
随后在 NPU 上执行 GPT 主干与 conditioning encoder 的真实 Linear/Conv1d 前向,
验证权重加载与算子执行全链路通过。29.7 秒内完成。