mstar.model.kokoro.config#
Kokoro-82M configuration, built from the checkpoint’s config.json.
The upstream kokoro package hard-codes a handful of architecture constants
outside its config (the 24 kHz sample rate and the harmonic source parameters
of the iSTFTNet generator, the 1024-wide decoder trunk, the 64-channel ASR
residual). They are fields here so nothing else in the package carries a
magic number.
Classes
|
PL-BERT: an ALBERT encoder over phoneme tokens ( |
|
The iSTFTNet generator ( |
|
Everything the M* Kokoro integration reads. |
- class mstar.model.kokoro.config.KokoroBertConfig(hidden_size=768, num_attention_heads=12, intermediate_size=2048, max_position_embeddings=512, num_hidden_layers=12, dropout=0.1, embedding_size=128, layer_norm_eps=1e-12)[source]#
Bases:
objectPL-BERT: an ALBERT encoder over phoneme tokens (
plbertin config.json).embedding_sizeandlayer_norm_epsare ALBERT defaults the checkpoint relies on without stating them.- Parameters:
- class mstar.model.kokoro.config.KokoroISTFTNetConfig(upsample_kernel_sizes=<factory>, upsample_rates=<factory>, gen_istft_hop_size=5, gen_istft_n_fft=20, resblock_dilation_sizes=<factory>, resblock_kernel_sizes=<factory>, upsample_initial_channel=512)[source]#
Bases:
objectThe iSTFTNet generator (
istftnetin config.json).- Parameters:
- class mstar.model.kokoro.config.KokoroModelConfig(n_token=178, hidden_dim=512, style_dim=128, n_layer=3, max_dur=50, dropout=0.2, n_mels=80, text_encoder_kernel_size=5, dim_in=64, max_conv_dim=512, multispeaker=True, vocab=<factory>, plbert=<factory>, istftnet=<factory>, sample_rate=24000, decoder_hidden=1024, asr_res_dim=64, source_harmonics=8, source_sine_amp=0.1, source_noise_std=0.003, source_voiced_threshold=10.0, weights_file='kokoro-v1_0.pth', voices_dir='voices', default_voice='af_heart', default_speed=1.0, min_speed=0.25, max_speed=4.0, first_chunk_target_phonemes=80, chunk_target_phonemes=200, max_chunks=512, text_buckets=<factory>, frame_buckets=<factory>, capture_batch_sizes=<factory>, max_batch_frames=16384, frame_grouping='bucket', decoder_dtype='float32', compile_decoder=True)[source]#
Bases:
objectEverything the M* Kokoro integration reads.
The top block mirrors
config.json; the serving block has M*-side defaults that a deployment can change through model kwargs.- Parameters:
n_token (int)
hidden_dim (int)
style_dim (int)
n_layer (int)
max_dur (int)
dropout (float)
n_mels (int)
text_encoder_kernel_size (int)
dim_in (int)
max_conv_dim (int)
multispeaker (bool)
plbert (KokoroBertConfig)
istftnet (KokoroISTFTNetConfig)
sample_rate (int)
decoder_hidden (int)
asr_res_dim (int)
source_harmonics (int)
source_sine_amp (float)
source_noise_std (float)
source_voiced_threshold (float)
weights_file (str)
voices_dir (str)
default_voice (str)
default_speed (float)
min_speed (float)
max_speed (float)
first_chunk_target_phonemes (int)
chunk_target_phonemes (int)
max_chunks (int)
max_batch_frames (int)
frame_grouping (str)
decoder_dtype (str)
compile_decoder (bool)
- istftnet: KokoroISTFTNetConfig#
- plbert: KokoroBertConfig#