Views
No views yet
| ✅ Recommended | ⚠️ Limitations |
|---|---|
| Voice cloning for assistants, IVR, audiobooks | Commercial use requires permission from IndexTTS authors |
| Research on low-resource TTS | Not robust to noisy transcripts; clean text is required |
| Emotion/style experiments | Emotion text prompts need Qwen assets (see config.yaml) |
checkpoints/ inside this repo or your Hugging Face space.pip install -U torch torchaudio soundfile sentencepiece modelscope huggingface_hub1from indextts.infer_v2 import IndexTTS2
2
3tts = IndexTTS2(
4 cfg_path="checkpoints/config.yaml",
5 model_dir="checkpoints",
6 use_fp16=True,
7 use_cuda_kernel=False,
8)
9
10result = tts.infer(
11 spk_audio_prompt="ref_audio.wav",
12 text="Chiến lược quân sự là nghệ thuật định hướng và sử dụng sức mạnh quân sự nhằm đạt được mục tiêu chính trị, và qua từng thời kỳ, con người đã phát triển nhiều cách tiếp cận khác nhau. Từ thời cổ đại, Tôn Tử đã nhấn mạnh yếu tố mưu lược và coi trọng việc giành thắng lợi bằng trí tuệ, tạo thế và đánh vào tâm lý đối phương hơn là chỉ dựa vào sức mạnh. Trong lịch sử, có những chiến lược như tiêu hao, tức là dùng sức mạnh liên tục để bào mòn lực lượng địch, hay quyết chiến nhanh, tập trung toàn bộ binh lực vào một trận đánh then chốt để xoay chuyển cục diện, như Hannibal ở Cannae hay Võ Nguyên Giáp ở Điện Biên Phủ. ",
13 output_path="gen.wav",
14 verbose=True,
15)
16print(result)infer_vi.py or the Gradio demo provided in this repository.checkpoints/config.yaml (or any required weights) are missing when you instantiate IndexTTS2, the code automatically downloads the full checkpoint bundle from this HuggingFace repo (dinhthuan/index-tts-2-vietnamese).INDEXTTS_HF_REPO=<user/repo> to pull from a different repository, or INDEXTTS_DISABLE_AUTO_DOWNLOAD=1 to skip the download (e.g., on air-gapped machines).tools/metadata_to_manifest.pytools/tokenizer/train_bpe.pytools/preprocess_multiproc.pytools/generate_gpt_pairs.pytrainers/train_gpt_v2.pyrun_metadata_pipeline.sh automates steps 1–4.checkpoints/gpt_old.pth (IndexTTS2 official release)@article{IndexTTS2,
title={IndexTTS2: Emotionally Expressive and Duration-Controlled Auto-Regressive Zero-Shot TTS},
author={IndexTTS Team},
journal={arXiv preprint arXiv:2506.21619},
year={2025}
}