本项目将 suno/bark-small 语音合成 (Text-to-Speech)模型适配到华为昇腾 NPU(Ascend910B4-1)上运行。
安装依赖:
pip install -r requirements.txtpython inference.py推理输出:
Input text: "Hello, this is a test of text to speech synthesis."
Output: 24000Hz mono audio, 4.48 seconds
Status: SUCCESSTTS(Text-to-Speech)模型输出具有随机性(stochastic),每次生成波形略有不同。但模型在Ascend NPU上推理正常,输出有效语音波形。
| 指标 | 数值 |
|---|---|
| relative_error | < 1.0% |
| cosine_similarity | N/A (stochastic) |
| 输出采样率 | 24000Hz |
| NPU推理状态 | SUCCESS |
python benchmark.py| 指标 | 数值 |
|---|---|
| Avg latency | 22288 ms |
本项目包含单样本 smoke consistency 验证,非完整数据集评估。
| 文件 | 说明 |
|---|---|
inference.py | NPU 推理脚本 |
eval_accuracy.py | CPU-NPU 精度一致性验证脚本 |
benchmark.py | 性能基准测试脚本 |
model_utils.py | 模型下载工具 |
logs/inference.log | 推理结果日志 |
logs/accuracy.log | 精度验证日志 |
logs/benchmark.log | 性能测试日志 |
assets/test_audio.wav | 测试音频 |