Views
No views yet
kanade-25hz-clean model trained on LibriTTS-R with HiFT vocoder for better audio quality. LibriTTS-R is a restored version of LibriTTS removing noise, so the model trained on it can produce cleaner synthesis. Because of that, however, this version can no longer faithfully reflect the recording environment such as background noise and microphone characteristics. Also, the vocoder is changed to the HiFT model used in CosyVoice 2 for better quality. The content encoder part remains the same as the previous kanade-25hz model. We made tiny code change to support different vocoders during inference (specifically load_vocoder). Please refer to the updated usage section below.| Model | Token Rate | Vocab Size | Bit Rate | Dataset | SSL Encoder | Vocoder | Parameters |
|---|---|---|---|---|---|---|---|
kanade-12.5hz | 12.5 Hz | 12800 | 171 bps | LibriTTS | WavLM-base+ | Vocos 24kHz | 120M |
kanade-25hz | 25 Hz | 12800 | 341 bps | LibriTTS | WavLM-base+ | Vocos 24kHz | 118M |
kanade-25hz-clean | 25 Hz | 12800 | 341 bps | LibriTTS-R | WavLM-base+ | HiFT 24kHz | 142M |
1# In your own project's virtual environment
2uv add git+https://github.com/frothywater/kanade-tokenizer
3# or using pip
4pip install git+https://github.com/frothywater/kanade-tokenizer[!IMPORTANT] We use FlashAttention for efficient local window attention in our training. We recommend installing it following the instructions in their repository to get the best performance and the closest match to our setup. The model will fall back to regular PyTorch SDPA implementation if FlashAttention is not available. In this case, we cannot guarantee the same quality as reported in the paper.
If using uv, you can install FlashAttention like:uv pip install flash-attn --no-build-isolation. (Ensureninjais installed in your system or the build will be very slow.)
1from kanade_tokenizer import KanadeModel, load_audio, load_vocoder, vocode
2
3# Load Kanade model
4model = KanadeModel.from_pretrained("frothywater/kanade-12.5hz")
5model = model.eval().cuda()
6
7# Load vocoder
8vocoder = load_vocoder(model.config.vocoder_name).cuda()
9
10# Load audio (samples,)
11audio = load_audio("path/to/audio.wav", sample_rate=model.config.sample_rate).cuda()
12
13# Extract features
14features = model.encode(waveform)
15
16# Synthesize audio from extracted features
17mel_spectrogram = model.decode(
18 content_token_indices=features.content_token_indices, # (seq_len,)
19 global_embedding=features.global_embedding, # (dim,)
20) # (n_mels, T)
21
22# Resynthesize waveform using vocoder
23resynthesized_waveform = vocode(vocoder, mel_spectrogram.unsqueeze(0)) # (1, samples)