Views
No views yet
![]() | ![]() |
![]() | ![]() |
pip install git+https://github.com/HumeAI/tada.gitpip install -e .| Model | Base Model | HuggingFace Hub |
|---|---|---|
| TADA-1B | Llama 3.2 1B | HumeAI/tada-1b |
| TADA-3B-ml | Llama 3.2 3B | HumeAI/tada-3b-ml |
HumeAI/tada-codec) and can be loaded using the same API.1import torch
2import torchaudio
3
4from tada.modules.encoder import Encoder, EncoderOutput
5from tada.modules.tada import TadaForCausalLM
6
7device = "cuda"
8
9# Encoder is loaded separately (not inside the model)
10encoder = Encoder.from_pretrained("HumeAI/tada-codec", subfolder="encoder").to(device)
11model = TadaForCausalLM.from_pretrained("HumeAI/tada-3b-ml", torch_dtype=torch.bfloat16).to(device)
12
13audio, sample_rate = torchaudio.load("samples/ljspeech.wav")
14audio = audio.to(device)
15prompt_text = "The examination and testimony of the experts, enabled the commission to conclude that five shots may have been fired."
16prompt = encoder(
17 audio, text=[prompt_text], sample_rate=sample_rate
18)
19
20# Optional: save prompt to skip encoder on future runs
21# prompt.save("prompt_cache.pt")
22# prompt = EncoderOutput.load("prompt_cache.pt", device=device)
23
24output = model.generate(
25 prompt=prompt,
26 text="Please call Stella. Ask her to bring these things with her from the store.",
27)language parameter when loading the encoder to use the appropriate aligner for your target language.1import torch
2import torchaudio
3
4from tada.modules.encoder import Encoder
5from tada.modules.tada import TadaForCausalLM
6
7device = "cuda"
8encoder = Encoder.from_pretrained("HumeAI/tada-codec", subfolder="encoder", language="ja").to(device)
9model = TadaForCausalLM.from_pretrained("HumeAI/tada-3b-ml", torch_dtype=torch.bfloat16).to(device)
10
11# Load a reference audio clip in the target language
12audio, sample_rate = torchaudio.load("samples/ja_prompt.wav")
13audio = audio.to(device)
14
15# For non-English prompts, provide the transcript so the encoder uses forced alignment
16# instead of the built-in ASR (which is English-only)
17prompt_text = "このムキムキのお兄さんがいるし バーだし少し高そうだと思いますよねこのバーの料金設定は良心的でした まあそんなに高くなかったです"
18prompt = encoder(audio, text=[prompt_text], sample_rate=sample_rate)
19
20output = model.generate(
21 prompt=prompt,
22 text="今日はとても良い天気ですね。散歩に行きましょう。",
23)ar, ch, de, es, fr, it, ja, pl, pt. When language is not specified, the default English aligner is used.Note: For non-English prompts, you should provide the transcript of the reference audio via thetextparameter. The encoder's built-in ASR is English-only. The generation will still work, but alignment quality will be degraded.
prompt.print_alignment(model.tokenizer)34 tokens | 10.50s audio
······The··exam····ination··and·····test···imony··of···thenum_extra_steps if you want to generate text-speech continuation of the prompt:1output = model.generate(
2 prompt=prompt,
3 num_extra_steps=50
4)1@article{dang2026tada,
2 title={TADA: A Generative Framework for Speech Modeling via Text-Acoustic Dual Alignment},
3 author={Dang, Trung and Rao, Sharath and Gupta, Ananya and Gagne, Christopher and Tzirakis, Panagiotis and Baird, Alice and Cłapa, Jakub Piotr and Chin, Peter and Cowen, Alan},
4 journal={arXiv preprint arXiv:2602.23068},
5 year={2026}
6}