MCPcopy Create free account

hub / github.com/bytedance/MegaTTS3 / functions

Functions298 in github.com/bytedance/MegaTTS3

↓ 22 callersMethodpad
(self)
tts/utils/text_utils/text_encoder.py:245
↓ 8 callersMethod__init__
(self, hidden_size, num_layers, ffn_kernel_size=9, dropout=0.0, num_heads=2, use_pos_embed=Tr
tts/modules/ar_dur/commons/transformer.py:677
↓ 7 callersMethodin_proj_v
(self, value)
tts/modules/ar_dur/commons/transformer.py:454
↓ 6 callersMethod__init__
(self, c, num_heads, dropout, attention_dropout=0.1, relu_dropout=0.1, kernel_size=9, ffn_hid
tts/modules/ar_dur/commons/rot_transformer.py:544
↓ 6 callersMethod__init__
(self, mult, r)
tts/modules/wavvae/decoder/hifigan_modules.py:36
↓ 6 callersFunctionconvert_pad_shape
(pad_shape)
tts/modules/ar_dur/commons/rel_transformer.py:23
↓ 6 callersFunctionget_padding
(kernel_size, dilation=1)
tts/modules/wavvae/decoder/hifigan_modules.py:31
↓ 6 callersMethodin_proj_k
(self, key)
tts/modules/ar_dur/commons/transformer.py:444
↓ 6 callersMethodin_proj_q
(self, query)
tts/modules/ar_dur/commons/transformer.py:435
↓ 5 callersFunctionEmbedding
(num_embeddings, embedding_dim, padding_idx=None)
tts/modules/ar_dur/commons/layers.py:59
↓ 5 callersFunctionWNConv1d
(*args, **kwargs)
tts/modules/wavvae/decoder/hifigan_modules.py:91
↓ 5 callersMethod__init__
(self, dim)
tts/modules/llm_dit/transformer.py:53
↓ 5 callersMethod__init__
(self, in_channels, out_channels, filter_channels, kernel_size, p_dropout=0., activation=None)
tts/modules/ar_dur/commons/rel_transformer.py:255
↓ 5 callersMethodencode
Transform a human-readable string into a sequence of int ids. The ids should be in the range [num_reserved_ids, vocab_size). Ids [0,
tts/utils/text_utils/text_encoder.py:62
↓ 5 callersFunctionload_ckpt
(cur_model, ckpt_base_dir, model_name='model', force=True, strict=True, silent=False, load_opt=F
tts/utils/commons/ckpt_utils.py:80
↓ 4 callersMethod__init__
(self)
tts/modules/aligner/whisper_small.py:247
↓ 4 callersMethod_get_input_buffer
(self, incremental_state)
tts/modules/ar_dur/commons/transformer.py:472
↓ 4 callersMethod_in_proj
(self, input, start=0, end=None)
tts/modules/ar_dur/commons/transformer.py:464
↓ 4 callersMethod_set_input_buffer
(self, incremental_state, buffer)
tts/modules/ar_dur/commons/transformer.py:479
↓ 4 callersFunctionpad_t_like_x
Function to reshape the time vector t by the number of dimensions of x. Parameters ---------- x : Tensor, shape (bs, *dim) repres
tts/modules/llm_dit/cfm.py:47
↓ 4 callersFunctionset_incremental_state
Helper for setting incremental state for an nn.Module.
tts/modules/ar_dur/commons/seq_utils.py:77
↓ 3 callersMethod_create_rotary_embed
(self, *, width: int, length: int)
tts/modules/ar_dur/commons/rot_transformer.py:134
↓ 3 callersFunctionexpand_states
(h, mel2token)
tts/modules/ar_dur/ar_dur_predictor.py:41
↓ 3 callersMethodforward_ling_encoder
( self, txt_tokens, ling_feas, char_tokens, ph2char, bert_embed, spk_id, spk_embed, mels_timbre)
tts/modules/ar_dur/ar_dur_predictor.py:87
↓ 3 callersFunctionget_incremental_state
Helper for getting incremental state for an nn.Module.
tts/modules/ar_dur/commons/seq_utils.py:69
↓ 3 callersMethodin_proj_qkv
(self, query)
tts/modules/ar_dur/commons/transformer.py:432
↓ 3 callersFunctionset_hparams
(config='', exp_name='', hparams_str='', print_hparams=True, global_hparams=True)
tts/utils/commons/hparams.py:103
↓ 3 callersFunctiontorch_load_dist
(path, map_location='cpu')
tts/utils/commons/ckpt_utils.py:55
↓ 2 callersMethod__init__
(self, *args)
tts/modules/ar_dur/commons/layers.py:42
↓ 2 callersMethod__init__
(self, in_channels: int, out_channels: int, kernel_size: int, stride: int = 1, dilation: int
tts/modules/wavvae/encoder/common_modules/conv.py:122
↓ 2 callersFunction_get_full_incremental_state_key
(module_instance, key)
tts/modules/ar_dur/commons/seq_utils.py:57
↓ 2 callersMethod_get_input_buffer
(self, incremental_state)
tts/modules/ar_dur/commons/transformer.py:129
↓ 2 callersMethod_get_relative_embeddings
(self, relative_embeddings, length)
tts/modules/ar_dur/commons/rel_transformer.py:196
↓ 2 callersMethod_init_vocab
Initialize vocabulary with tokens from token_generator.
tts/utils/text_utils/text_encoder.py:229
↓ 2 callersMethod_set_input_buffer
(self, incremental_state, buffer)
tts/modules/ar_dur/commons/transformer.py:136
↓ 2 callersMethodapply_sparse_mask
(self, attn_weights, tgt_len, src_len, bsz)
tts/modules/ar_dur/commons/transformer.py:487
↓ 2 callersMethodattention
(self, query, key, value, mask=None)
tts/modules/ar_dur/commons/rel_transformer.py:145
↓ 2 callersFunctionchunk_text_chinesev2
将中文文本分成多个块,优先确保每个块以句号、感叹号或问号结尾, 其次考虑逗号等其他标点符号,避免在无标点处断句 参数: text: 要分块的文本 limit: 每个块的中文字符数限制 look_ahead_limit
tts/utils/text_utils/split_text.py:90
↓ 2 callersFunctionchunk_text_english
Splits the input text into chunks, each with a maximum number of characters. Args: text (str): The text to be split. max_cha
tts/utils/text_utils/split_text.py:60
↓ 2 callersMethodcompute_sigma_t
Compute the standard deviation of the probability path N(t * x1 + (1 - t) * x0, sigma), see (Eq.14) [1]. Parameters --------
tts/modules/llm_dit/cfm.py:115
↓ 2 callersMethodencode
(self, audio)
tts/modules/wavvae/decoder/wavvae_v3.py:46
↓ 2 callersMethodeos
(self)
tts/utils/text_utils/text_encoder.py:248
↓ 2 callersMethodforward
(self, resource_context, input_text, time_step, p_w, t_w, dur_disturb=0.1, dur_alpha=1.0, **kwargs)
tts/infer_cli.py:210
↓ 2 callersMethodforward
(self, x)
tts/modules/ar_dur/commons/layers.py:46
↓ 2 callersMethodforward_ling_encoder
(self, txt_tokens, tone_tokens)
tts/modules/llm_dit/dit.py:101
↓ 2 callersMethodget_embedding
Build sinusoidal embeddings. This matches the implementation in tensor2tensor, but differs slightly from the description in Section 3
tts/modules/ar_dur/commons/rot_transformer.py:47
↓ 2 callersMethodget_embedding
Build sinusoidal embeddings. This matches the implementation in tensor2tensor, but differs slightly from the description in Section 3
tts/modules/ar_dur/commons/transformer.py:45
↓ 2 callersFunctionget_last_checkpoint
(work_dir, steps=None)
tts/utils/commons/ckpt_utils.py:61
↓ 2 callersMethodinfer
(self, txt_tokens, ling_feas, char_tokens, ph2char, bert_embed, spk_id=None, spk_embed=None, mel
tts/modules/ar_dur/ar_dur_predictor.py:265
↓ 2 callersFunctionload_config
(config_fn, config_chains, loaded_configs)
tts/utils/commons/hparams.py:76
↓ 2 callersFunctionmake_positions
Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols are ignored.
tts/modules/ar_dur/commons/seq_utils.py:20
↓ 2 callersFunctionoverride_config
(old_config: dict, new_config: dict)
tts/utils/commons/hparams.py:32
↓ 2 callersFunctionpad1d
(x: torch.Tensor, paddings: tp.Tuple[int, int], mode: str = 'zero', value: float = 0.)
tts/modules/wavvae/encoder/common_modules/conv.py:79
↓ 2 callersMethodpreprocess
(self, audio_bytes, latent_file=None, topk_dur=1, **kwargs)
tts/infer_cli.py:171
↓ 2 callersMethodsample
(self, generator=None)
tts/modules/wavvae/decoder/diag_gaussian.py:31
↓ 2 callersMethodsample_one_step
(self, vq_pred)
tts/modules/ar_dur/ar_dur_predictor.py:130
↓ 2 callersMethodsequence_mask
(self, seq_lens, max_len=None, device='cpu')
tts/modules/aligner/whisper_small.py:311
↓ 2 callersFunctionsoftmax
(x, dim)
tts/modules/ar_dur/commons/seq_utils.py:35
↓ 1 callersMethod__init__
(self, dim, freq_embed_dim=256)
tts/modules/llm_dit/time_embedding.py:35
↓ 1 callersMethod__init__
(self, hparams, hidden_size, dec_hidden_size, lm_num_layers, dict_size, code_size)
tts/modules/ar_dur/ar_dur_predictor.py:49
↓ 1 callersMethod__init__
(self, dim)
tts/modules/ar_dur/commons/nar_tts_modules.py:62
↓ 1 callersMethod__init__
(self, channels: int = 1, dimension: int = 128, n_filters: int = 32, n_residual_layers: int = 1,
tts/modules/wavvae/encoder/common_modules/seanet.py:73
↓ 1 callersMethod__init__
(self, num_reserved_ids=NUM_RESERVED_TOKENS)
tts/utils/text_utils/text_encoder.py:55
↓ 1 callersMethod_absolute_position_to_relative_position
x: [b, h, l, l] ret: [b, h, l, 2*l-1]
tts/modules/ar_dur/commons/rel_transformer.py:228
↓ 1 callersMethod_attention_bias_proximal
Bias for self-attention to encourage attention to close positions. Args: length: an integer scalar. Returns: a Ten
tts/modules/ar_dur/commons/rel_transformer.py:242
↓ 1 callersMethod_forward
When we use torchdiffeq, we need to include the CFG process inside _forward()
tts/modules/llm_dit/dit.py:114
↓ 1 callersMethod_init_vocab_from_file
Load vocab from a file. Args: filename: The file to load vocabulary from.
tts/utils/text_utils/text_encoder.py:197
↓ 1 callersMethod_init_vocab_from_list
Initialize tokens from a list of tokens. It is ok if reserved tokens appear in the vocab list. They will be removed. The set of token
tts/utils/text_utils/text_encoder.py:212
↓ 1 callersMethod_matmul_with_relative_keys
x: [b, h, l, d] y: [h or 1, m, d] ret: [b, h, l, m]
tts/modules/ar_dur/commons/rel_transformer.py:187
↓ 1 callersMethod_matmul_with_relative_values
x: [b, h, l, m] y: [h or 1, m, d] ret: [b, h, l, d]
tts/modules/ar_dur/commons/rel_transformer.py:178
↓ 1 callersMethod_relative_position_to_absolute_position
x: [b, h, l, 2*l-1] ret: [b, h, l, l]
tts/modules/ar_dur/commons/rel_transformer.py:211
↓ 1 callersMethod_rotate
Rotate the input tensor by half of its innermost width. input (Tensor): array to rotate. RETURNS (Tensor): rotated array. Sh
tts/modules/ar_dur/commons/rot_transformer.py:149
↓ 1 callersMethod_safe_id_to_token
(self, idx)
tts/utils/text_utils/text_encoder.py:194
↓ 1 callersFunctionalign
(self, wav)
tts/frontend_function.py:40
↓ 1 callersFunctionapply_parametrization_norm
(module: nn.Module, norm: str = 'none')
tts/modules/wavvae/encoder/common_modules/conv.py:47
↓ 1 callersFunctionapply_rotary_emb
( xq: torch.Tensor, xk: torch.Tensor, freqs_cis: torch.Tensor, )
tts/modules/llm_dit/transformer.py:39
↓ 1 callersMethodbuffered_future_mask
(self, tensor)
tts/modules/ar_dur/ar_dur_predictor.py:159
↓ 1 callersFunctionbuild_gradio_launch_kwargs
()
tts/gradio_api.py:62
↓ 1 callersMethodbuild_model
(self, device)
tts/infer_cli.py:106
↓ 1 callersFunctionchunk_text_chinese
(text, limit=60)
tts/utils/text_utils/split_text.py:18
↓ 1 callersMethodclear_buffer
(self, input, encoder_out=None, encoder_padding_mask=None, incremental_state=None)
tts/modules/ar_dur/commons/rot_transformer.py:604
↓ 1 callersMethodclear_buffer
(self, input, encoder_out=None, encoder_padding_mask=None, incremental_state=None)
tts/modules/ar_dur/commons/transformer.py:631
↓ 1 callersFunctioncombine_audio_segments
(segments, crossfade_duration=0.16, sr=24000)
tts/utils/audio_utils/io.py:95
↓ 1 callersMethodcompute_conditional_flow
Compute the conditional vector field ut(x1|x0) = x1 - x0, see Eq.(15) [1]. Parameters ---------- x0 : Tensor, shape
tts/modules/llm_dit/cfm.py:161
↓ 1 callersMethodcompute_mu_t
Compute the mean of the probability path N(t * x1 + (1 - t) * x0, sigma), see (Eq.14) [1]. Parameters ---------- x0
tts/modules/llm_dit/cfm.py:92
↓ 1 callersFunctionconvert_to_wav
(wav_path)
tts/infer_cli.py:49
↓ 1 callersFunctionconvert_to_wav_bytes
(audio_binary)
tts/utils/audio_utils/io.py:85
↓ 1 callersFunctioncut_wav
(wav_path, max_len=28)
tts/infer_cli.py:67
↓ 1 callersMethoddecode
(self, latent)
tts/modules/wavvae/decoder/wavvae_v3.py:52
↓ 1 callersMethoddecode
Transform a sequence of int ids into a human-readable string. EOS is not expected in ids. Args: ids: list of integers to be
tts/utils/text_utils/text_encoder.py:78
↓ 1 callersMethoddecode_list
Transform a sequence of int ids into a their string versions. This method supports transforming individual input/output ids to their
tts/utils/text_utils/text_encoder.py:95
↓ 1 callersMethoddecode_list
(self, ids)
tts/utils/text_utils/text_encoder.py:183
↓ 1 callersMethoddevice
(self)
tts/modules/aligner/whisper_small.py:275
↓ 1 callersFunctiondist_load
(path)
tts/utils/commons/ckpt_utils.py:28
↓ 1 callersFunctiondur_pred
(self, ctx_dur_tokens, incremental_state_dur_prompt, ph_pred, tone_pred, seg_i, dur_disturb, dur_alpha, is_fir
tts/frontend_function.py:95
↓ 1 callersMethodembed_audio
(self, mel: torch.Tensor)
tts/modules/aligner/whisper_small.py:261
↓ 1 callersMethodencode_latent
(self, audio)
tts/modules/wavvae/decoder/wavvae_v3.py:41
↓ 1 callersFunctionfill_with_neg_inf2
FP16-compatible function that fills a tensor with -inf.
tts/modules/ar_dur/ar_dur_predictor.py:37
↓ 1 callersMethodforward
(self, x: Tensor)
tts/modules/aligner/whisper_small.py:48
↓ 1 callersMethodforward
:param x: [B, T, C] :param padding_mask: [B, T] :return: [B, T, C] or [L, B, T, C]
tts/modules/ar_dur/commons/transformer.py:706
next →1–100 of 298, ranked by callers