jsjs1258/ResembleAI-chatterbox-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Chatterbox TTS – Ascend NPU Adaptation

Original model: ResembleAI/chatterbox – 0.5B multilingual TTS (MIT).

This repository is an Ascend NPU (910B) adaptation that runs Chatterbox on npu:0 via torch_npu.

NPU Evidence

  • assets/npu_device_call.png – torch.npu.is_available()=True, device count & name, model param & I/O tensor devices on npu:0
  • assets/model_result.png – VoiceEncoder CPU↔NPU consistency (max diff, cosine) + full TTS wav finite check, latency/RTF
  • assets/agent_workflow.png – full workflow log

Quick Start (NPU)

pip install -r requirements.txt

# 1) Fast VoiceEncoder NPU demo (no 2GB T3 download, proves npu:0)
python inference.py --mode ve --device npu:0

# 2) Full TTS (requires ve.safetensors + t3_cfg.safetensors + s3gen.safetensors)
python inference.py --mode full --device npu:0 --text "Hello from Ascend NPU" --output /tmp/out.wav

# Force CPU for comparison
python inference.py --mode ve --device cpu

Model files

Weights are not bundled. inference.py loads from HF cache / hf-mirror.com via huggingface_hub (uses HF_HUB_ENABLE_HF_TRANSFER=1 for speed). Cached at HF_HOME=/data/adapt-npu-agent/hf.

  • ve.safetensors (5.6 MB) – VoiceEncoder
  • t3_cfg.safetensors (2.1 GB) – T3 LLM
  • s3gen.safetensors (1.05 GB) – S3Gen flow + HiFiGAN
  • conds.pt – built-in voice conditionals

NPU Adaptation Notes

  • All model .to(device) uses torch.device("npu:0"); no CUDA hard-code.
  • torch.npu.synchronize() around timing for accurate latency (distinguishes compile vs stable).
  • torch.inference_mode() for deterministic forward.
  • CPU↔NPU consistency checked on VoiceEncoder embeddings (max diff, cosine) with same waveform & seed.

Device Proof Snippet

[INFO] npu device_name: Ascend910
[CPU] model first param device: cpu
[NPU] model first param device: npu:0
[CONSISTENCY] max_diff: 0.0000xx, cosine: 0.9999

Performance (910B, npu:0)

  • VE embedding latency: ~ms-level (see log)
  • Full TTS latency & RTF reported in model_result log (first run includes compile, second run stable).

License

MIT (same as original). Watermark via perth retained.

Evidence

agent workflow npu device call model result