SYMBOL INDEX (786 symbols across 87 files) FILE: cosyvoice/bin/average_model.py function get_args (line 24) | def get_args(): function main (line 43) | def main(): FILE: cosyvoice/bin/export_jit.py function get_args (line 30) | def get_args(): function get_optimized_script (line 41) | def get_optimized_script(model, preserved_attrs=[]): function main (line 51) | def main(): FILE: cosyvoice/bin/export_onnx.py function get_dummy_input (line 34) | def get_dummy_input(batch_size, seq_len, out_channels, device): function get_args (line 44) | def get_args(): function main (line 56) | def main(): FILE: cosyvoice/bin/train.py function get_args (line 40) | def get_args(): function main (line 98) | def main(): FILE: cosyvoice/cli/cosyvoice.py class CosyVoice (line 27) | class CosyVoice: method __init__ (line 29) | def __init__(self, model_dir, load_jit=False, load_trt=False, fp16=Fal... method list_available_spks (line 65) | def list_available_spks(self): method add_zero_shot_spk (line 69) | def add_zero_shot_spk(self, prompt_text, prompt_wav, zero_shot_spk_id): method save_spkinfo (line 77) | def save_spkinfo(self): method inference_sft (line 80) | def inference_sft(self, tts_text, spk_id, stream=False, speed=1.0, tex... method inference_zero_shot (line 91) | def inference_zero_shot(self, tts_text, prompt_text, prompt_wav, zero_... method inference_cross_lingual (line 105) | def inference_cross_lingual(self, tts_text, prompt_wav, zero_shot_spk_... method inference_instruct (line 116) | def inference_instruct(self, tts_text, spk_id, instruct_text, stream=F... method inference_vc (line 129) | def inference_vc(self, source_wav, prompt_wav, stream=False, speed=1.0): class CosyVoice2 (line 139) | class CosyVoice2(CosyVoice): method __init__ (line 141) | def __init__(self, model_dir, load_jit=False, load_trt=False, load_vll... method inference_instruct2 (line 177) | def inference_instruct2(self, tts_text, instruct_text, prompt_wav, zer... class CosyVoice3 (line 189) | class CosyVoice3(CosyVoice2): method __init__ (line 191) | def __init__(self, model_dir, load_trt=False, load_vllm=False, fp16=Fa... function AutoModel (line 228) | def AutoModel(**kwargs): FILE: cosyvoice/cli/frontend.py class CosyVoiceFrontEnd (line 30) | class CosyVoiceFrontEnd: method __init__ (line 32) | def __init__(self, method _extract_text_token (line 78) | def _extract_text_token(self, text): method _extract_text_token_generator (line 89) | def _extract_text_token_generator(self, text_generator): method _extract_speech_token (line 95) | def _extract_speech_token(self, prompt_wav): method _extract_spk_embedding (line 108) | def _extract_spk_embedding(self, prompt_wav): method _extract_speech_feat (line 120) | def _extract_speech_feat(self, prompt_wav): method text_normalize (line 127) | def text_normalize(self, text, split=True, text_frontend=True): method frontend_sft (line 162) | def frontend_sft(self, tts_text, spk_id): method frontend_zero_shot (line 168) | def frontend_zero_shot(self, tts_text, prompt_text, prompt_wav, resamp... method frontend_cross_lingual (line 191) | def frontend_cross_lingual(self, tts_text, prompt_wav, resample_rate, ... method frontend_instruct (line 200) | def frontend_instruct(self, tts_text, spk_id, instruct_text): method frontend_instruct2 (line 209) | def frontend_instruct2(self, tts_text, instruct_text, prompt_wav, resa... method frontend_vc (line 215) | def frontend_vc(self, source_speech_16k, prompt_wav, resample_rate): FILE: cosyvoice/cli/model.py class CosyVoiceModel (line 29) | class CosyVoiceModel: method __init__ (line 31) | def __init__(self, method load (line 65) | def load(self, llm_model, flow_model, hift_model): method load_jit (line 75) | def load_jit(self, llm_text_encoder_model, llm_llm_model, flow_encoder... method load_trt (line 83) | def load_trt(self, flow_decoder_estimator_model, flow_decoder_onnx_mod... method get_trt_kwargs (line 94) | def get_trt_kwargs(self): method llm_job (line 101) | def llm_job(self, text, prompt_text, llm_prompt_speech_token, llm_embe... method vc_job (line 131) | def vc_job(self, source_speech_token, uuid): method token2wav (line 135) | def token2wav(self, token, prompt_token, prompt_feat, embedding, uuid,... method tts (line 175) | def tts(self, text=torch.zeros(1, 0, dtype=torch.int32), flow_embeddin... class CosyVoice2Model (line 245) | class CosyVoice2Model(CosyVoiceModel): method __init__ (line 247) | def __init__(self, method load_jit (line 277) | def load_jit(self, flow_encoder_model): method load_vllm (line 281) | def load_vllm(self, model_dir): method token2wav (line 292) | def token2wav(self, token, prompt_token, prompt_feat, embedding, token... method tts (line 328) | def tts(self, text=torch.zeros(1, 0, dtype=torch.int32), flow_embeddin... class CosyVoice3Model (line 397) | class CosyVoice3Model(CosyVoice2Model): method __init__ (line 399) | def __init__(self, method token2wav (line 425) | def token2wav(self, token, prompt_token, prompt_feat, embedding, token... FILE: cosyvoice/dataset/dataset.py class Processor (line 26) | class Processor(IterableDataset): method __init__ (line 28) | def __init__(self, source, f, *args, **kw): method set_epoch (line 35) | def set_epoch(self, epoch): method __iter__ (line 38) | def __iter__(self): method apply (line 46) | def apply(self, f): class DistributedSampler (line 51) | class DistributedSampler: method __init__ (line 53) | def __init__(self, shuffle=True, partition=True): method update (line 59) | def update(self): method set_epoch (line 79) | def set_epoch(self, epoch): method sample (line 82) | def sample(self, data): class DataList (line 107) | class DataList(IterableDataset): method __init__ (line 109) | def __init__(self, lists, shuffle=True, partition=True): method set_epoch (line 113) | def set_epoch(self, epoch): method __iter__ (line 116) | def __iter__(self): function Dataset (line 125) | def Dataset(data_list_file, FILE: cosyvoice/dataset/processor.py function parquet_opener (line 31) | def parquet_opener(data, mode='train'): function filter (line 55) | def filter(data, function resample (line 109) | def resample(data, resample_rate=22050, min_sample_rate=16000, mode='tra... function truncate (line 137) | def truncate(data, truncate_length=24576, mode='train'): function compute_fbank (line 158) | def compute_fbank(data, function compute_whisper_fbank (line 183) | def compute_whisper_fbank(data, num_frames=-1, mode='train'): function compute_f0 (line 200) | def compute_f0(data, sample_rate, hop_size, mode='train'): function parse_embedding (line 225) | def parse_embedding(data, normalize, mode='train'): function tokenize (line 248) | def tokenize(data, get_tokenizer, allowed_special, mode='train'): function shuffle (line 267) | def shuffle(data, shuffle_size=10000, mode='train'): function sort (line 292) | def sort(data, sort_size=500, mode='train'): function static_batch (line 320) | def static_batch(data, batch_size=16): function dynamic_batch (line 340) | def dynamic_batch(data, max_frames_in_batch=12000, mode='train'): function batch (line 369) | def batch(data, batch_type='static', batch_size=16, max_frames_in_batch=... function padding (line 380) | def padding(data, use_spk_embedding, mode='train', gan=False, dpo=False): FILE: cosyvoice/flow/DiT/dit.py class TextEmbedding (line 33) | class TextEmbedding(nn.Module): method __init__ (line 34) | def __init__(self, text_num_embeds, text_dim, conv_layers=0, conv_mult... method forward (line 48) | def forward(self, text: int["b nt"], seq_len, drop_text=False): # noq... class InputEmbedding (line 76) | class InputEmbedding(nn.Module): method __init__ (line 77) | def __init__(self, mel_dim, text_dim, out_dim, spk_dim=None): method forward (line 84) | def forward( class DiT (line 104) | class DiT(nn.Module): method __init__ (line 105) | def __init__( method forward (line 145) | def forward(self, x, mask, mu, t, spks=None, cond=None, streaming=False): FILE: cosyvoice/flow/DiT/modules.py class MelSpec (line 24) | class MelSpec(nn.Module): method __init__ (line 25) | def __init__( method forward (line 54) | def forward(self, inp): class SinusPositionEmbedding (line 71) | class SinusPositionEmbedding(nn.Module): method __init__ (line 72) | def __init__(self, dim): method forward (line 76) | def forward(self, x, scale=1000): class ConvPositionEmbedding (line 89) | class ConvPositionEmbedding(nn.Module): method __init__ (line 90) | def __init__(self, dim, kernel_size=31, groups=16): method forward (line 100) | def forward(self, x: float["b n d"], mask: bool["b n"] | None = None):... class CausalConvPositionEmbedding (line 115) | class CausalConvPositionEmbedding(nn.Module): method __init__ (line 116) | def __init__(self, dim, kernel_size=31, groups=16): method forward (line 129) | def forward(self, x: float["b n d"], mask: bool["b n"] | None = None):... function precompute_freqs_cis (line 150) | def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0, the... function get_pos_embed_indices (line 164) | def get_pos_embed_indices(start, length, max_pos, scale=1.0): class GRN (line 179) | class GRN(nn.Module): method __init__ (line 180) | def __init__(self, dim): method forward (line 185) | def forward(self, x): class ConvNeXtV2Block (line 195) | class ConvNeXtV2Block(nn.Module): method __init__ (line 196) | def __init__( method forward (line 213) | def forward(self, x: torch.Tensor) -> torch.Tensor: class AdaLayerNormZero (line 230) | class AdaLayerNormZero(nn.Module): method __init__ (line 231) | def __init__(self, dim): method forward (line 239) | def forward(self, x, emb=None): class AdaLayerNormZero_Final (line 251) | class AdaLayerNormZero_Final(nn.Module): method __init__ (line 252) | def __init__(self, dim): method forward (line 260) | def forward(self, x, emb): class FeedForward (line 271) | class FeedForward(nn.Module): method __init__ (line 272) | def __init__(self, dim, dim_out=None, mult=4, dropout=0.0, approximate... method forward (line 281) | def forward(self, x): class Attention (line 289) | class Attention(nn.Module): method __init__ (line 290) | def __init__( method forward (line 332) | def forward( class AttnProcessor (line 349) | class AttnProcessor: method __init__ (line 350) | def __init__(self): method __call__ (line 353) | def __call__( class JointAttnProcessor (line 414) | class JointAttnProcessor: method __init__ (line 415) | def __init__(self): method __call__ (line 418) | def __call__( class DiTBlock (line 500) | class DiTBlock(nn.Module): method __init__ (line 501) | def __init__(self, dim, heads, dim_head, ff_mult=4, dropout=0.1): method forward (line 516) | def forward(self, x, t, mask=None, rope=None): # x: noised input, t: ... class MMDiTBlock (line 536) | class MMDiTBlock(nn.Module): method __init__ (line 546) | def __init__(self, dim, heads, dim_head, ff_mult=4, dropout=0.1, conte... method forward (line 572) | def forward(self, x, c, t, mask=None, rope=None, c_rope=None): # x: n... class TimestepEmbedding (line 606) | class TimestepEmbedding(nn.Module): method __init__ (line 607) | def __init__(self, dim, freq_embed_dim=256): method forward (line 612) | def forward(self, timestep: float["b"]): # noqa: F821 FILE: cosyvoice/flow/decoder.py class Transpose (line 25) | class Transpose(torch.nn.Module): method __init__ (line 26) | def __init__(self, dim0: int, dim1: int): method forward (line 31) | def forward(self, x: torch.Tensor) -> torch.Tensor: class CausalConv1d (line 36) | class CausalConv1d(torch.nn.Conv1d): method __init__ (line 37) | def __init__( method forward (line 59) | def forward(self, x: torch.Tensor) -> torch.Tensor: class CausalBlock1D (line 65) | class CausalBlock1D(Block1D): method __init__ (line 66) | def __init__(self, dim: int, dim_out: int): method forward (line 76) | def forward(self, x: torch.Tensor, mask: torch.Tensor) -> Tuple[torch.... class CausalResnetBlock1D (line 81) | class CausalResnetBlock1D(ResnetBlock1D): method __init__ (line 82) | def __init__(self, dim: int, dim_out: int, time_emb_dim: int, groups: ... class ConditionalDecoder (line 88) | class ConditionalDecoder(nn.Module): method __init__ (line 89) | def __init__( method initialize_weights (line 196) | def initialize_weights(self): method forward (line 210) | def forward(self, x, mask, mu, t, spks=None, cond=None, streaming=False): class CausalConditionalDecoder (line 294) | class CausalConditionalDecoder(ConditionalDecoder): method __init__ (line 295) | def __init__( method forward (line 405) | def forward(self, x, mask, mu, t, spks=None, cond=None, streaming=False): FILE: cosyvoice/flow/flow.py class MaskedDiffWithXvec (line 25) | class MaskedDiffWithXvec(torch.nn.Module): method __init__ (line 26) | def __init__(self, method forward (line 58) | def forward( method inference (line 103) | def inference(self, class CausalMaskedDiffWithXvec (line 149) | class CausalMaskedDiffWithXvec(torch.nn.Module): method __init__ (line 150) | def __init__(self, method forward (line 186) | def forward( method inference (line 236) | def inference(self, class CausalMaskedDiffWithDiT (line 284) | class CausalMaskedDiffWithDiT(torch.nn.Module): method __init__ (line 285) | def __init__(self, method forward (line 320) | def forward( method inference (line 370) | def inference(self, FILE: cosyvoice/flow/flow_matching.py class ConditionalCFM (line 21) | class ConditionalCFM(BASECFM): method __init__ (line 22) | def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, ... method forward (line 37) | def forward(self, mu, mask, n_timesteps, temperature=1.0, spks=None, c... method solve_euler (line 71) | def solve_euler(self, x, t_span, mu, mask, spks, cond, streaming=False): method forward_estimator (line 126) | def forward_estimator(self, x, mask, mu, t, spks, cond, streaming=False): method compute_loss (line 155) | def compute_loss(self, x1, mask, mu, spks=None, cond=None, streaming=F... class CausalConditionalCFM (line 196) | class CausalConditionalCFM(ConditionalCFM): method __init__ (line 197) | def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, ... method forward (line 203) | def forward(self, mu, mask, n_timesteps, temperature=1.0, spks=None, c... FILE: cosyvoice/flow/length_regulator.py class InterpolateRegulator (line 21) | class InterpolateRegulator(nn.Module): method __init__ (line 22) | def __init__( method forward (line 44) | def forward(self, x, ylens=None): method inference (line 52) | def inference(self, x1, x2, mel_len1, mel_len2, input_frame_rate=50): FILE: cosyvoice/hifigan/discriminator.py class MultipleDiscriminator (line 15) | class MultipleDiscriminator(nn.Module): method __init__ (line 16) | def __init__( method forward (line 23) | def forward(self, y: torch.Tensor, y_hat: torch.Tensor): class MultiResolutionDiscriminator (line 38) | class MultiResolutionDiscriminator(nn.Module): method __init__ (line 39) | def __init__( method forward (line 59) | def forward( class DiscriminatorR (line 78) | class DiscriminatorR(nn.Module): method __init__ (line 79) | def __init__( method spectrogram (line 113) | def spectrogram(self, x): method forward (line 125) | def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor = N... class MultiResSpecDiscriminator (line 149) | class MultiResSpecDiscriminator(torch.nn.Module): method __init__ (line 151) | def __init__(self, method forward (line 163) | def forward(self, y, y_hat): function stft (line 179) | def stft(x, fft_size, hop_size, win_length, window): class SpecDiscriminator (line 196) | class SpecDiscriminator(nn.Module): method __init__ (line 199) | def __init__(self, fft_size=1024, shift_size=120, win_length=600, wind... method forward (line 216) | def forward(self, y): FILE: cosyvoice/hifigan/f0_predictor.py class ConvRNNF0Predictor (line 23) | class ConvRNNF0Predictor(nn.Module): method __init__ (line 24) | def __init__(self, method forward (line 56) | def forward(self, x: torch.Tensor) -> torch.Tensor: class CausalConvRNNF0Predictor (line 62) | class CausalConvRNNF0Predictor(nn.Module): method __init__ (line 63) | def __init__(self, method forward (line 95) | def forward(self, x: torch.Tensor, finalize: bool = True) -> torch.Ten... FILE: cosyvoice/hifigan/generator.py class ResBlock (line 46) | class ResBlock(torch.nn.Module): method __init__ (line 48) | def __init__( method forward (line 110) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 119) | def remove_weight_norm(self): class SineGen (line 125) | class SineGen(torch.nn.Module): method __init__ (line 141) | def __init__(self, samp_rate, harmonic_num=0, method _f02uv (line 151) | def _f02uv(self, f0): method forward (line 157) | def forward(self, f0): class SineGen2 (line 192) | class SineGen2(torch.nn.Module): method __init__ (line 208) | def __init__(self, samp_rate, upsample_scale, harmonic_num=0, method _f02uv (line 228) | def _f02uv(self, f0): method _f02sine (line 233) | def _f02sine(self, f0_values): method forward (line 289) | def forward(self, f0): class SourceModuleHnNSF (line 320) | class SourceModuleHnNSF(torch.nn.Module): method __init__ (line 338) | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine... method forward (line 358) | def forward(self, x): class HiFTGenerator (line 378) | class HiFTGenerator(nn.Module): method __init__ (line 383) | def __init__( method remove_weight_norm (line 477) | def remove_weight_norm(self): method _stft (line 491) | def _stft(self, x): method _istft (line 499) | def _istft(self, magnitude, phase): method decode (line 507) | def decode(self, x: torch.Tensor, s: torch.Tensor = torch.zeros(1, 1, ... method forward (line 541) | def forward( method inference (line 558) | def inference(self, speech_feat: torch.Tensor, cache_source: torch.Ten... class CausalHiFTGenerator (line 572) | class CausalHiFTGenerator(HiFTGenerator): method __init__ (line 577) | def __init__( method decode (line 672) | def decode(self, x: torch.Tensor, s: torch.Tensor = torch.zeros(1, 1, ... method inference (line 714) | def inference(self, speech_feat: torch.Tensor, finalize: bool = True) ... FILE: cosyvoice/hifigan/hifigan.py class HiFiGan (line 9) | class HiFiGan(nn.Module): method __init__ (line 10) | def __init__(self, generator, discriminator, mel_spec_transform, method forward (line 22) | def forward( method forward_generator (line 32) | def forward_generator(self, batch, device): method forward_discriminator (line 53) | def forward_discriminator(self, batch, device): FILE: cosyvoice/llm/llm.py class TransformerLM (line 34) | class TransformerLM(torch.nn.Module): method __init__ (line 35) | def __init__( method encode (line 81) | def encode( method pad_unpad_sequence (line 91) | def pad_unpad_sequence(self, sos_emb, embedding, text_token, text_toke... method forward (line 100) | def forward( method sampling_ids (line 150) | def sampling_ids( method inference (line 163) | def inference( class Qwen2Encoder (line 226) | class Qwen2Encoder(torch.nn.Module): method __init__ (line 227) | def __init__(self, pretrain_path): method forward (line 231) | def forward(self, xs: torch.Tensor, xs_lens: torch.Tensor): method forward_one_step (line 242) | def forward_one_step(self, xs, masks, cache=None): class Qwen2LM (line 257) | class Qwen2LM(TransformerLM): method __init__ (line 258) | def __init__( method prepare_lm_input_target (line 302) | def prepare_lm_input_target(self, sos_emb, text_token, text_token_emb,... method forward (line 351) | def forward( method forward_dpo (line 407) | def forward_dpo( method inference (line 459) | def inference( method inference_wrapper (line 505) | def inference_wrapper(self, lm_input, sampling, min_len, max_len, uuid): method inference_bistream (line 552) | def inference_bistream( class CosyVoice3LM (line 664) | class CosyVoice3LM(Qwen2LM): method __init__ (line 665) | def __init__( FILE: cosyvoice/tokenizer/tokenizer.py function get_encoding (line 170) | def get_encoding(name: str = "gpt2", num_languages: int = 99): function get_tokenizer (line 210) | def get_tokenizer( class CosyVoice2Tokenizer (line 241) | class CosyVoice2Tokenizer(): method __init__ (line 242) | def __init__(self, token_path, skip_special_tokens=True): method encode (line 263) | def encode(self, text, **kwargs): method decode (line 268) | def decode(self, tokens): class CosyVoice3Tokenizer (line 274) | class CosyVoice3Tokenizer(CosyVoice2Tokenizer): method __init__ (line 275) | def __init__(self, token_path, skip_special_tokens=True): function get_qwen_tokenizer (line 317) | def get_qwen_tokenizer( FILE: cosyvoice/transformer/activation.py class Swish (line 24) | class Swish(torch.nn.Module): method forward (line 27) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Snake (line 34) | class Snake(nn.Module): method __init__ (line 50) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 73) | def forward(self, x): FILE: cosyvoice/transformer/attention.py class MultiHeadedAttention (line 26) | class MultiHeadedAttention(nn.Module): method __init__ (line 36) | def __init__(self, method forward_qkv (line 53) | def forward_qkv( method forward_attention (line 82) | def forward_attention( method forward (line 129) | def forward( class RelPositionMultiHeadedAttention (line 200) | class RelPositionMultiHeadedAttention(MultiHeadedAttention): method __init__ (line 209) | def __init__(self, method rel_shift (line 225) | def rel_shift(self, x: torch.Tensor) -> torch.Tensor: method forward (line 249) | def forward( FILE: cosyvoice/transformer/convolution.py class ConvolutionModule (line 25) | class ConvolutionModule(nn.Module): method __init__ (line 28) | def __init__(self, method forward (line 91) | def forward( class CausalConv1d (line 150) | class CausalConv1d(torch.nn.Conv1d): method __init__ (line 151) | def __init__( method forward (line 176) | def forward(self, x: torch.Tensor, cache: torch.Tensor = torch.zeros(0... class CausalConv1dDownSample (line 190) | class CausalConv1dDownSample(torch.nn.Conv1d): method __init__ (line 191) | def __init__( method forward (line 214) | def forward(self, x: torch.Tensor, cache: torch.Tensor = torch.zeros(0... class CausalConv1dUpsample (line 224) | class CausalConv1dUpsample(torch.nn.Conv1d): method __init__ (line 225) | def __init__( method forward (line 248) | def forward(self, x: torch.Tensor, cache: torch.Tensor = torch.zeros(0... FILE: cosyvoice/transformer/decoder.py class TransformerDecoder (line 33) | class TransformerDecoder(torch.nn.Module): method __init__ (line 58) | def __init__( method forward (line 116) | def forward( method forward_layers (line 169) | def forward_layers(self, x: torch.Tensor, tgt_mask: torch.Tensor, method forward_layers_checkpointed (line 178) | def forward_layers_checkpointed(self, x: torch.Tensor, method forward_one_step (line 187) | def forward_one_step( method tie_or_clone_weights (line 230) | def tie_or_clone_weights(self, jit_mode: bool = True): class BiTransformerDecoder (line 256) | class BiTransformerDecoder(torch.nn.Module): method __init__ (line 276) | def __init__( method forward (line 332) | def forward( method forward_one_step (line 367) | def forward_one_step( method tie_or_clone_weights (line 392) | def tie_or_clone_weights(self, jit_mode: bool = True): FILE: cosyvoice/transformer/decoder_layer.py class DecoderLayer (line 22) | class DecoderLayer(nn.Module): method __init__ (line 41) | def __init__( method forward (line 62) | def forward( FILE: cosyvoice/transformer/embedding.py class PositionalEncoding (line 26) | class PositionalEncoding(torch.nn.Module): method __init__ (line 37) | def __init__(self, method forward (line 59) | def forward(self, method position_encoding (line 79) | def position_encoding(self, class RelPositionalEncoding (line 120) | class RelPositionalEncoding(PositionalEncoding): method __init__ (line 129) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 5... method forward (line 133) | def forward(self, class WhisperPositionalEncoding (line 150) | class WhisperPositionalEncoding(PositionalEncoding): method __init__ (line 154) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 1... class LearnablePositionalEncoding (line 167) | class LearnablePositionalEncoding(PositionalEncoding): method __init__ (line 171) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 4... class NoPositionalEncoding (line 178) | class NoPositionalEncoding(torch.nn.Module): method __init__ (line 182) | def __init__(self, d_model: int, dropout_rate: float): method forward (line 187) | def forward(self, method position_encoding (line 196) | def position_encoding(self, offset: Union[int, torch.Tensor], class EspnetRelPositionalEncoding (line 201) | class EspnetRelPositionalEncoding(torch.nn.Module): method __init__ (line 215) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 5... method extend_pe (line 224) | def extend_pe(self, x: torch.Tensor): method forward (line 256) | def forward(self, x: torch.Tensor, offset: Union[int, torch.Tensor] = ... method position_encoding (line 272) | def position_encoding(self, FILE: cosyvoice/transformer/encoder.py class BaseEncoder (line 37) | class BaseEncoder(torch.nn.Module): method __init__ (line 39) | def __init__( method output_size (line 108) | def output_size(self) -> int: method forward (line 111) | def forward( method forward_layers (line 165) | def forward_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, method forward_layers_checkpointed (line 173) | def forward_layers_checkpointed(self, xs: torch.Tensor, method forward_chunk (line 184) | def forward_chunk( method forward_chunk_by_chunk (line 275) | def forward_chunk_by_chunk( class TransformerEncoder (line 338) | class TransformerEncoder(BaseEncoder): method __init__ (line 341) | def __init__( class ConformerEncoder (line 387) | class ConformerEncoder(BaseEncoder): method __init__ (line 390) | def __init__( FILE: cosyvoice/transformer/encoder_layer.py class TransformerEncoderLayer (line 24) | class TransformerEncoderLayer(nn.Module): method __init__ (line 40) | def __init__( method forward (line 58) | def forward( class ConformerEncoderLayer (line 109) | class ConformerEncoderLayer(nn.Module): method __init__ (line 129) | def __init__( method forward (line 160) | def forward( FILE: cosyvoice/transformer/label_smoothing_loss.py class LabelSmoothingLoss (line 21) | class LabelSmoothingLoss(nn.Module): method __init__ (line 54) | def __init__(self, method forward (line 68) | def forward(self, x: torch.Tensor, target: torch.Tensor) -> torch.Tensor: FILE: cosyvoice/transformer/positionwise_feed_forward.py class PositionwiseFeedForward (line 20) | class PositionwiseFeedForward(torch.nn.Module): method __init__ (line 33) | def __init__( method forward (line 47) | def forward(self, xs: torch.Tensor) -> torch.Tensor: class MoEFFNLayer (line 58) | class MoEFFNLayer(torch.nn.Module): method __init__ (line 75) | def __init__( method forward (line 91) | def forward(self, xs: torch.Tensor) -> torch.Tensor: FILE: cosyvoice/transformer/subsampling.py class BaseSubsampling (line 23) | class BaseSubsampling(torch.nn.Module): method __init__ (line 25) | def __init__(self): method position_encoding (line 30) | def position_encoding(self, offset: Union[int, torch.Tensor], class EmbedinigNoSubsampling (line 35) | class EmbedinigNoSubsampling(BaseSubsampling): method __init__ (line 39) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 45) | def forward( class LinearNoSubsampling (line 69) | class LinearNoSubsampling(BaseSubsampling): method __init__ (line 79) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 92) | def forward( class Conv1dSubsampling2 (line 116) | class Conv1dSubsampling2(BaseSubsampling): method __init__ (line 128) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 145) | def forward( class Conv2dSubsampling4 (line 173) | class Conv2dSubsampling4(BaseSubsampling): method __init__ (line 183) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 202) | def forward( class Conv2dSubsampling6 (line 230) | class Conv2dSubsampling6(BaseSubsampling): method __init__ (line 239) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 256) | def forward( class Conv2dSubsampling8 (line 282) | class Conv2dSubsampling8(BaseSubsampling): method __init__ (line 292) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 311) | def forward( class LegacyLinearNoSubsampling (line 338) | class LegacyLinearNoSubsampling(BaseSubsampling): method __init__ (line 348) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 362) | def forward( FILE: cosyvoice/transformer/upsample_encoder.py class Upsample1D (line 37) | class Upsample1D(nn.Module): method __init__ (line 51) | def __init__(self, channels: int, out_channels: int, stride: int = 2): method forward (line 59) | def forward(self, inputs: torch.Tensor, input_lengths: torch.Tensor) -... class PreLookaheadLayer (line 66) | class PreLookaheadLayer(nn.Module): method __init__ (line 67) | def __init__(self, in_channels: int, channels: int, pre_lookahead_len:... method forward (line 82) | def forward(self, inputs: torch.Tensor, context: torch.Tensor = torch.... class UpsampleConformerEncoder (line 106) | class UpsampleConformerEncoder(torch.nn.Module): method __init__ (line 108) | def __init__( method output_size (line 241) | def output_size(self) -> int: method forward (line 244) | def forward( method forward_layers (line 309) | def forward_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, method forward_up_layers (line 316) | def forward_up_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, FILE: cosyvoice/utils/class_utils.py function get_model_type (line 77) | def get_model_type(configs): FILE: cosyvoice/utils/common.py function pad_list (line 56) | def pad_list(xs: List[torch.Tensor], pad_value: int): function th_accuracy (line 105) | def th_accuracy(pad_outputs: torch.Tensor, pad_targets: torch.Tensor, function get_padding (line 127) | def get_padding(kernel_size, dilation=1): function init_weights (line 131) | def init_weights(m, mean=0.0, std=0.01): function ras_sampling (line 138) | def ras_sampling(weighted_scores, decoded_tokens, sampling, top_p=0.8, t... function nucleus_sampling (line 147) | def nucleus_sampling(weighted_scores, top_p=0.8, top_k=25): function random_sampling (line 165) | def random_sampling(weighted_scores, decoded_tokens, sampling): function fade_in_out (line 170) | def fade_in_out(fade_in_mel, fade_out_mel, window): function set_all_random_seed (line 181) | def set_all_random_seed(seed): function mask_to_bias (line 188) | def mask_to_bias(mask: torch.Tensor, dtype: torch.dtype) -> torch.Tensor: class TrtContextWrapper (line 199) | class TrtContextWrapper: method __init__ (line 200) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 210) | def acquire_estimator(self): method release_estimator (line 213) | def release_estimator(self, context, stream): FILE: cosyvoice/utils/executor.py class Executor (line 26) | class Executor: method __init__ (line 28) | def __init__(self, gan: bool = False, ref_model: torch.nn.Module = Non... method train_one_epoc (line 37) | def train_one_epoc(self, model, optimizer, scheduler, train_data_loade... method train_one_epoc_gan (line 88) | def train_one_epoc_gan(self, model, optimizer, scheduler, optimizer_d,... method cv (line 147) | def cv(self, model, cv_data_loader, writer, info_dict, on_batch_end=Tr... FILE: cosyvoice/utils/file_utils.py function read_lists (line 27) | def read_lists(list_file): function read_json_lists (line 35) | def read_json_lists(list_file): function load_wav (line 44) | def load_wav(wav, target_sr, min_sr=16000): function convert_onnx_to_trt (line 53) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, fp16): function export_cosyvoice2_vllm (line 92) | def export_cosyvoice2_vllm(model, model_path, device): FILE: cosyvoice/utils/frontend_utils.py function contains_chinese (line 21) | def contains_chinese(text): function replace_corner_mark (line 26) | def replace_corner_mark(text): function remove_bracket (line 33) | def remove_bracket(text): function spell_out_number (line 42) | def spell_out_number(text: str, inflect_parser): function split_paragraph (line 65) | def split_paragraph(text: str, tokenize, lang="zh", token_max_n=80, toke... function replace_blank (line 121) | def replace_blank(text: str): function is_only_punctuation (line 133) | def is_only_punctuation(text): FILE: cosyvoice/utils/losses.py function tpr_loss (line 6) | def tpr_loss(disc_real_outputs, disc_generated_outputs, tau): function mel_loss (line 15) | def mel_loss(real_speech, generated_speech, mel_transforms): class DPOLoss (line 24) | class DPOLoss(torch.nn.Module): method __init__ (line 29) | def __init__(self, beta: float, label_smoothing: float = 0.0, ipo: boo... method forward (line 35) | def forward( FILE: cosyvoice/utils/mask.py function subsequent_mask (line 53) | def subsequent_mask( function subsequent_chunk_mask_deprecated (line 89) | def subsequent_chunk_mask_deprecated( function subsequent_chunk_mask (line 127) | def subsequent_chunk_mask( function add_optional_chunk_mask (line 161) | def add_optional_chunk_mask(xs: torch.Tensor, function make_pad_mask (line 239) | def make_pad_mask(lengths: torch.Tensor, max_len: int = 0) -> torch.Tensor: FILE: cosyvoice/utils/onnx.py class SpeechTokenExtractor (line 7) | class SpeechTokenExtractor(): method __init__ (line 8) | def __init__(self, model_path): method inference (line 17) | def inference(self, feat, feat_lengths, device): class EmbeddingExtractor (line 26) | class EmbeddingExtractor(): method __init__ (line 27) | def __init__(self, model_path): method inference (line 36) | def inference(self, speech): FILE: cosyvoice/utils/scheduler.py class WarmupLR (line 27) | class WarmupLR(_LRScheduler): method __init__ (line 44) | def __init__( method __repr__ (line 56) | def __repr__(self): method get_lr (line 59) | def get_lr(self): method set_step (line 70) | def set_step(self, step: int): class WarmupPolicy (line 74) | class WarmupPolicy(_LRScheduler): method __init__ (line 84) | def __init__(self, method get_lr (line 110) | def get_lr(self): method _get_warmup_lr (line 128) | def _get_warmup_lr(self, step): method _get_lr (line 132) | def _get_lr(self, step): class SquareRootConstantPolicy (line 137) | class SquareRootConstantPolicy(_LRScheduler): method __init__ (line 147) | def __init__(self, method get_lr (line 175) | def get_lr(self): method _get_lr (line 193) | def _get_lr(self, step): class WarmupHoldPolicy (line 198) | class WarmupHoldPolicy(WarmupPolicy): method __init__ (line 212) | def __init__( method get_lr (line 257) | def get_lr(self): class WarmupAnnealHoldPolicy (line 282) | class WarmupAnnealHoldPolicy(_LRScheduler): method __init__ (line 295) | def __init__( method get_lr (line 340) | def get_lr(self): method _get_warmup_lr (line 365) | def _get_warmup_lr(self, step): method _get_constant_lr (line 369) | def _get_constant_lr(self, step): method _get_lr (line 372) | def _get_lr(self, step): function _squareroot_annealing (line 377) | def _squareroot_annealing(initial_lr, step, max_steps, min_lr): function _square_annealing (line 384) | def _square_annealing(initial_lr, step, max_steps, min_lr): function _cosine_annealing (line 391) | def _cosine_annealing(initial_lr, step, max_steps, min_lr): function _linear_warmup_with_cosine_annealing (line 397) | def _linear_warmup_with_cosine_annealing(max_lr, warmup_steps, step, function _poly_decay (line 421) | def _poly_decay(initial_lr, step, decay_steps, power, min_lr, cycle): function _noam_hold_annealing (line 433) | def _noam_hold_annealing(initial_lr, step, warmup_steps, hold_steps, class SquareAnnealing (line 444) | class SquareAnnealing(WarmupPolicy): method __init__ (line 446) | def __init__(self, method _get_lr (line 459) | def _get_lr(self, step): class SquareRootAnnealing (line 471) | class SquareRootAnnealing(WarmupPolicy): method __init__ (line 473) | def __init__(self, method _get_lr (line 486) | def _get_lr(self, step): class CosineAnnealing (line 497) | class CosineAnnealing(WarmupAnnealHoldPolicy): method __init__ (line 499) | def __init__(self, method _get_lr (line 512) | def _get_lr(self, step): method _get_warmup_lr (line 532) | def _get_warmup_lr(self, step): method _get_constant_lr (line 539) | def _get_constant_lr(self, step): method _get_linear_warmup_with_cosine_annealing_lr (line 543) | def _get_linear_warmup_with_cosine_annealing_lr(self, step): class NoamAnnealing (line 558) | class NoamAnnealing(_LRScheduler): method __init__ (line 560) | def __init__(self, method get_lr (line 588) | def get_lr(self): method _noam_annealing (line 610) | def _noam_annealing(self, initial_lr, step): class NoamHoldAnnealing (line 623) | class NoamHoldAnnealing(WarmupHoldPolicy): method __init__ (line 625) | def __init__(self, method _get_lr (line 693) | def _get_lr(self, step): method set_step (line 715) | def set_step(self, step: int): class ConstantLR (line 719) | class ConstantLR(_LRScheduler): method __init__ (line 726) | def __init__( method get_lr (line 734) | def get_lr(self): method set_step (line 737) | def set_step(self, step: int): FILE: cosyvoice/utils/train_utils.py function init_distributed (line 39) | def init_distributed(args): function init_dataset_and_dataloader (line 53) | def init_dataset_and_dataloader(args, configs, gan, dpo): function check_modify_and_save_config (line 72) | def check_modify_and_save_config(args, configs): function wrap_cuda_model (line 94) | def wrap_cuda_model(args, model): function init_optimizer_and_scheduler (line 111) | def init_optimizer_and_scheduler(args, configs, model, gan): function init_summarywriter (line 187) | def init_summarywriter(args): function save_model (line 195) | def save_model(model, model_name, info_dict): function cosyvoice_join (line 217) | def cosyvoice_join(group_join, info_dict): function batch_forward (line 238) | def batch_forward(model, batch, scaler, info_dict, ref_model=None, dpo_l... function batch_backward (line 277) | def batch_backward(model, scaler, info_dict): function update_parameter_and_lr (line 291) | def update_parameter_and_lr(model, optimizer, scheduler, scaler, info_di... function log_per_step (line 323) | def log_per_step(writer, info_dict): function log_per_save (line 352) | def log_per_save(writer, info_dict): FILE: cosyvoice/vllm/cosyvoice2.py class CosyVoice2ForCausalLM (line 38) | class CosyVoice2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP): method __init__ (line 51) | def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): method get_input_embeddings (line 82) | def get_input_embeddings(self, input_ids: torch.Tensor) -> torch.Tensor: method forward (line 85) | def forward( method compute_logits (line 96) | def compute_logits( method load_weights (line 109) | def load_weights(self, weights: Iterable[tuple[str, FILE: example.py function cosyvoice_example (line 7) | def cosyvoice_example(): function cosyvoice2_example (line 36) | def cosyvoice2_example(): function cosyvoice3_example (line 71) | def cosyvoice3_example(): function main (line 105) | def main(): FILE: examples/grpo/cosyvoice2/huggingface_to_pretrained.py function get_args (line 25) | def get_args(): FILE: examples/grpo/cosyvoice2/infer_dataset.py function audio_decode_cosyvoice2 (line 59) | def audio_decode_cosyvoice2( function extract_speech_ids (line 96) | def extract_speech_ids(speech_tokens_str): function convert_cosy2_tokens_to_speech_id_str (line 109) | def convert_cosy2_tokens_to_speech_id_str(cosy2_tokens): function get_args (line 117) | def get_args(): function data_collator (line 186) | def data_collator(batch, tokenizer, s3_tokenizer): function init_distributed (line 269) | def init_distributed(): function main (line 282) | def main(): FILE: examples/grpo/cosyvoice2/prepare_data.py function make_map_fn (line 40) | def make_map_fn(split): FILE: examples/grpo/cosyvoice2/pretrained_to_huggingface.py function get_args (line 33) | def get_args(): FILE: examples/grpo/cosyvoice2/reward_tts.py function _parse_ids (line 34) | def _parse_ids(token_str: str) -> List[int]: function _remote_reward (line 38) | def _remote_reward(tokens: List[int], ground_truth: str, timeout: float ... function compute_score (line 86) | def compute_score( function get_args (line 121) | def get_args(): function load_jsonl (line 156) | def load_jsonl(file_path: str): function code_to_solution_str (line 164) | def code_to_solution_str(code_list: List[int]) -> str: FILE: examples/grpo/cosyvoice2/scripts/offline-decode-files.py function remove_punctuation (line 104) | def remove_punctuation(text: str) -> str: function store_transcripts (line 112) | def store_transcripts( function write_error_stats (line 137) | def write_error_stats( function get_args (line 308) | def get_args(): function assert_file_exists (line 556) | def assert_file_exists(filename: str): function read_wave (line 564) | def read_wave(wave_filename: str) -> Tuple[np.ndarray, int]: function normalize_text_alimeeting (line 588) | def normalize_text_alimeeting(text: str) -> str: function main (line 623) | def main(): FILE: examples/grpo/cosyvoice2/token2wav_asr_server.py class _ASR_Server (line 53) | class _ASR_Server: method __init__ (line 56) | def __init__(self, device_id: int): method __call__ (line 60) | def __call__(self, WAV: np.ndarray, WAV_LENS: np.ndarray, LANGUAGE: np... function audio_decode_cosyvoice2 (line 79) | def audio_decode_cosyvoice2( function get_random_prompt_from_dataset (line 116) | def get_random_prompt_from_dataset(dataset): class _Token2Wav_ASR (line 142) | class _Token2Wav_ASR: method __init__ (line 145) | def __init__(self, device_id: int): method __call__ (line 166) | def __call__(self, TOKENS: np.ndarray, TOKEN_LENS: np.ndarray, GT_TEXT... function _infer_function_factory (line 241) | def _infer_function_factory(device_ids: List[int], model_name: str): function main (line 252) | def main(): FILE: examples/libritts/cosyvoice/local/prepare_data.py function main (line 11) | def main(): FILE: examples/libritts/cosyvoice/local/prepare_reject_sample.py function main (line 14) | def main(): FILE: examples/magicdata-read/cosyvoice/local/prepare_data.py function main (line 10) | def main(): FILE: runtime/python/fastapi/client.py function main (line 22) | def main(): FILE: runtime/python/fastapi/server.py function generate_data (line 40) | def generate_data(model_output): function inference_sft (line 48) | async def inference_sft(tts_text: str = Form(), spk_id: str = Form()): function inference_zero_shot (line 55) | async def inference_zero_shot(tts_text: str = Form(), prompt_text: str =... function inference_cross_lingual (line 63) | async def inference_cross_lingual(tts_text: str = Form(), prompt_wav: Up... function inference_instruct (line 71) | async def inference_instruct(tts_text: str = Form(), spk_id: str = Form(... function inference_instruct2 (line 78) | async def inference_instruct2(tts_text: str = Form(), instruct_text: str... FILE: runtime/python/grpc/client.py function main (line 30) | def main(): FILE: runtime/python/grpc/server.py class CosyVoiceServiceImpl (line 34) | class CosyVoiceServiceImpl(cosyvoice_pb2_grpc.CosyVoiceServicer): method __init__ (line 35) | def __init__(self, args): method Inference (line 39) | def Inference(self, request, context): function main (line 68) | def main(): FILE: runtime/triton_trtllm/client_grpc.py class UserData (line 63) | class UserData: method __init__ (line 64) | def __init__(self): method record_start_time (line 70) | def record_start_time(self): method get_first_chunk_latency (line 73) | def get_first_chunk_latency(self): method get_second_chunk_latency (line 78) | def get_second_chunk_latency(self): function callback (line 84) | def callback(user_data, result, error): function stream_callback (line 97) | def stream_callback(user_data_map, result, error): function write_triton_stats (line 112) | def write_triton_stats(stats, summary_file): function subtract_stats (line 159) | def subtract_stats(stats_after, stats_before): function get_args (line 217) | def get_args(): function load_audio (line 344) | def load_audio(wav_path, target_sample_rate=16000): function prepare_request_input_output (line 359) | def prepare_request_input_output( function run_sync_streaming_inference (line 412) | def run_sync_streaming_inference( function send_streaming (line 501) | async def send_streaming( function send (line 595) | async def send( function load_manifests (line 644) | def load_manifests(manifest_path): function split_data (line 664) | def split_data(data, k): function main (line 687) | async def main(): function run_main (line 915) | async def run_main(): FILE: runtime/triton_trtllm/client_http.py function get_args (line 32) | def get_args(): function prepare_request (line 86) | def prepare_request( FILE: runtime/triton_trtllm/infer_cosyvoice3.py function send_request_async (line 38) | async def send_request_async(client, url, payload): function send_batch_requests_async (line 45) | async def send_batch_requests_async(api_base, model_name, chats, tempera... function extract_speech_ids (line 64) | def extract_speech_ids(speech_tokens_str): function convert_cosy3_tokens_to_speech_id_str (line 77) | def convert_cosy3_tokens_to_speech_id_str(cosy3_tokens): function get_args (line 87) | def get_args(): function data_collator (line 163) | def data_collator(batch, tokenizer, s3_tokenizer): function main (line 219) | def main(args): FILE: runtime/triton_trtllm/model_repo/audio_tokenizer/1/model.py class TritonPythonModel (line 39) | class TritonPythonModel: method initialize (line 46) | def initialize(self, args): method execute (line 60) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo/cosyvoice2/1/model.py class TritonPythonModel (line 48) | class TritonPythonModel: method initialize (line 55) | def initialize(self, args): method forward_llm (line 89) | def forward_llm(self, input_ids): method forward_audio_tokenizer (line 175) | def forward_audio_tokenizer(self, wav, wav_len): method forward_speaker_embedding (line 201) | def forward_speaker_embedding(self, wav): method forward_token2wav (line 226) | def forward_token2wav( method parse_input (line 282) | def parse_input(self, text, prompt_text, prompt_speech_tokens): method _extract_speech_feat (line 290) | def _extract_speech_feat(self, speech): method _llm_gen_thread (line 307) | def _llm_gen_thread(self, generated_ids_iter, semantic_token_ids_arr, ... method execute (line 315) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo/cosyvoice2_dit/1/model.py function parse_speech_token_string (line 52) | def parse_speech_token_string(response_text: str) -> List[int]: class TritonPythonModel (line 70) | class TritonPythonModel: method initialize (line 77) | def initialize(self, args): method _convert_speech_tokens_to_str (line 108) | def _convert_speech_tokens_to_str(self, speech_tokens: Union[torch.Ten... method forward_llm_async (line 121) | async def forward_llm_async(self, target_text: str, reference_text: st... method forward_audio_tokenizer (line 181) | def forward_audio_tokenizer(self, wav, wav_len): method forward_speaker_embedding (line 207) | def forward_speaker_embedding(self, wav): method forward_token2wav (line 232) | async def forward_token2wav( method _extract_speech_feat (line 278) | def _extract_speech_feat(self, speech): method _process_request (line 295) | async def _process_request(self, request): method execute (line 375) | async def execute(self, requests): method finalize (line 391) | def finalize(self): FILE: runtime/triton_trtllm/model_repo/speaker_embedding/1/model.py class TritonPythonModel (line 40) | class TritonPythonModel: method initialize (line 47) | def initialize(self, args): method load_spk_trt (line 74) | def load_spk_trt(self, spk_model, spk_onnx_model, trt_concurrent=1, fp... method get_spk_trt_kwargs (line 84) | def get_spk_trt_kwargs(self): method _extract_spk_embedding (line 91) | def _extract_spk_embedding(self, speech): method execute (line 127) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo/token2wav/1/model.py class CosyVoice2 (line 52) | class CosyVoice2: method __init__ (line 54) | def __init__(self, model_dir, load_jit=False, load_trt=False, fp16=Fal... class CosyVoice2Model (line 75) | class CosyVoice2Model: method __init__ (line 77) | def __init__(self, method load_jit (line 96) | def load_jit(self, flow_encoder_model): method load (line 100) | def load(self, flow_model, hift_model): method load_trt (line 108) | def load_trt(self, flow_decoder_estimator_model, flow_decoder_onnx_mod... method get_trt_kwargs (line 119) | def get_trt_kwargs(self): method token2wav (line 126) | def token2wav(self, token, prompt_token, prompt_feat, embedding, token... class TritonPythonModel (line 163) | class TritonPythonModel: method initialize (line 170) | def initialize(self, args): method execute (line 197) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo/token2wav_dit/1/model.py function get_spk_id_from_prompt_audio (line 56) | def get_spk_id_from_prompt_audio(tensor: torch.Tensor) -> str: class TritonPythonModel (line 71) | class TritonPythonModel: method initialize (line 78) | def initialize(self, args): method execute (line 99) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo/token2wav_dit/1/token2wav_dit.py function fade_in_out (line 38) | def fade_in_out(fade_in_mel: torch.Tensor, fade_out_mel: torch.Tensor, w... function convert_onnx_to_trt (line 49) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, dtype): class TrtContextWrapper (line 95) | class TrtContextWrapper: method __init__ (line 96) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 107) | def acquire_estimator(self): method release_estimator (line 110) | def release_estimator(self, context, stream): class CosyVoice2_Token2Wav (line 114) | class CosyVoice2_Token2Wav(torch.nn.Module): method __init__ (line 115) | def __init__(self, model_dir: str, enable_trt: bool = False, device_id... method forward_spk_embedding (line 175) | def forward_spk_embedding(self, spk_feat): method load_spk_trt (line 204) | def load_spk_trt(self, spk_model, spk_onnx_model, trt_concurrent=1, fp... method get_spk_trt_kwargs (line 214) | def get_spk_trt_kwargs(self): method load_trt (line 221) | def load_trt(self, flow_decoder_estimator_model, flow_decoder_onnx_mod... method get_trt_kwargs_dynamic_batch (line 237) | def get_trt_kwargs_dynamic_batch(self, opt_batch_size=2, max_batch_siz... method prompt_audio_tokenization (line 264) | def prompt_audio_tokenization(self, prompt_audios_list: list[torch.Ten... method get_spk_emb (line 279) | def get_spk_emb(self, prompt_audios_list: list[torch.Tensor]) -> torch... method get_prompt_mels (line 293) | def get_prompt_mels(self, prompt_audios_list: list[torch.Tensor], prom... method forward_flow (line 311) | def forward_flow(self, prompt_speech_tokens_list: list[list[int]], method forward_hift (line 334) | def forward_hift(self, generated_mels: torch.Tensor, generated_mels_le... method forward (line 344) | def forward( method prepare_prompt_audio (line 359) | def prepare_prompt_audio( method get_prompt_audio_cache_for_streaming_tts (line 371) | def get_prompt_audio_cache_for_streaming_tts( method forward_streaming (line 390) | def forward_streaming( function collate_fn (line 465) | def collate_fn(batch): function get_args (line 477) | def get_args(): FILE: runtime/triton_trtllm/model_repo_cosyvoice3/audio_tokenizer/1/model.py class TritonPythonModel (line 39) | class TritonPythonModel: method initialize (line 46) | def initialize(self, args): method execute (line 60) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo_cosyvoice3/cosyvoice3/1/model.py function parse_speech_token_string (line 25) | def parse_speech_token_string(response_text): class TritonPythonModel (line 39) | class TritonPythonModel: method initialize (line 47) | def initialize(self, args): method _convert_speech_tokens_to_str (line 72) | def _convert_speech_tokens_to_str(self, speech_tokens): method _extract_speech_feat (line 78) | def _extract_speech_feat(self, speech): method forward_llm_streaming (line 84) | async def forward_llm_streaming(self, target_text, reference_text, pro... method forward_llm_offline (line 139) | async def forward_llm_offline(self, target_text, reference_text, promp... method forward_audio_tokenizer (line 167) | def forward_audio_tokenizer(self, wav, wav_len): method forward_speaker_embedding (line 181) | def forward_speaker_embedding(self, wav): method forward_token2wav (line 195) | async def forward_token2wav(self, target_speech_tokens, prompt_speech_... method forward_vocoder (line 232) | async def forward_vocoder(self, mel, finalize): method _prepare_prompt (line 253) | def _prepare_prompt(self, request): method _process_request_streaming (line 305) | async def _process_request_streaming(self, request): method _process_request_offline (line 434) | async def _process_request_offline(self, request): method execute (line 469) | async def execute(self, requests): method finalize (line 489) | def finalize(self): FILE: runtime/triton_trtllm/model_repo_cosyvoice3/speaker_embedding/1/model.py class TritonPythonModel (line 40) | class TritonPythonModel: method initialize (line 47) | def initialize(self, args): method load_spk_trt (line 74) | def load_spk_trt(self, spk_model, spk_onnx_model, trt_concurrent=1, fp... method get_spk_trt_kwargs (line 84) | def get_spk_trt_kwargs(self): method _extract_spk_embedding (line 91) | def _extract_spk_embedding(self, speech): method execute (line 127) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo_cosyvoice3/token2wav/1/model.py class TrtContextWrapper (line 16) | class TrtContextWrapper: method __init__ (line 17) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 27) | def acquire_estimator(self): method release_estimator (line 30) | def release_estimator(self, context, stream): function convert_onnx_to_trt (line 34) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, fp16, autocas... class TritonPythonModel (line 75) | class TritonPythonModel: method initialize (line 81) | def initialize(self, args): method load_trt (line 109) | def load_trt(self, model_dir, trt_concurrent=1): method get_trt_kwargs (line 126) | def get_trt_kwargs(self): method execute (line 134) | def execute(self, requests): FILE: runtime/triton_trtllm/model_repo_cosyvoice3/vocoder/1/model.py class TritonPythonModel (line 16) | class TritonPythonModel: method initialize (line 23) | def initialize(self, args): method execute (line 47) | def execute(self, requests): FILE: runtime/triton_trtllm/offline_inference.py function send_request_async (line 56) | async def send_request_async(client, url, payload): function send_batch_requests_async (line 63) | async def send_batch_requests_async(api_base, model_name, chats, tempera... function extract_speech_ids (line 82) | def extract_speech_ids(speech_tokens_str): function convert_cosy2_tokens_to_speech_id_str (line 95) | def convert_cosy2_tokens_to_speech_id_str(cosy2_tokens): function get_args (line 103) | def get_args(): function data_collator (line 209) | def data_collator(batch, tokenizer, s3_tokenizer): function init_distributed (line 312) | def init_distributed(): function main (line 325) | def main(args): FILE: runtime/triton_trtllm/scripts/convert_checkpoint.py function parse_arguments (line 18) | def parse_arguments(): function args_to_quant_config (line 152) | def args_to_quant_config(args: argparse.Namespace) -> QuantConfig: function update_quant_config_from_hf (line 186) | def update_quant_config_from_hf(quant_config, hf_config, function args_to_build_options (line 216) | def args_to_build_options(args): function convert_and_save_hf (line 225) | def convert_and_save_hf(args): function execute (line 282) | def execute(workers, func, args): function main (line 301) | def main(): FILE: runtime/triton_trtllm/scripts/convert_cosyvoice3_to_hf.py function parse_args (line 48) | def parse_args(): function load_cosyvoice3_model (line 72) | def load_cosyvoice3_model(model_dir: str): function get_speech_token_size (line 100) | def get_speech_token_size(llm) -> int: function convert_cosyvoice3_to_hf (line 109) | def convert_cosyvoice3_to_hf( function main (line 346) | def main(): FILE: runtime/triton_trtllm/scripts/fill_template.py function split (line 6) | def split(string, delimiter): function main (line 34) | def main(file_path, substitutions, in_place): FILE: runtime/triton_trtllm/scripts/test_llm.py function parse_arguments (line 29) | def parse_arguments(args=None): function parse_input (line 47) | def parse_input(tokenizer, function main (line 69) | def main(args): FILE: runtime/triton_trtllm/streaming_inference.py function collate_fn (line 13) | def collate_fn(batch): function get_args (line 28) | def get_args(): FILE: runtime/triton_trtllm/token2wav.py function convert_onnx_to_trt (line 36) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, fp16): class TrtContextWrapper (line 74) | class TrtContextWrapper: method __init__ (line 75) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 86) | def acquire_estimator(self): method release_estimator (line 89) | def release_estimator(self, context, stream): class CosyVoice2_Token2Wav (line 93) | class CosyVoice2_Token2Wav(torch.nn.Module): method __init__ (line 94) | def __init__(self, model_dir: str = "./CosyVoice2-0.5B", enable_trt: b... method forward_spk_embedding (line 127) | def forward_spk_embedding(self, spk_feat): method load_spk_trt (line 156) | def load_spk_trt(self, spk_model, spk_onnx_model, trt_concurrent=1, fp... method get_spk_trt_kwargs (line 166) | def get_spk_trt_kwargs(self): method load_trt (line 173) | def load_trt(self, flow_decoder_estimator_model, flow_decoder_onnx_mod... method get_trt_kwargs_dynamic_batch (line 185) | def get_trt_kwargs_dynamic_batch(self, opt_bs=2, max_batch_size=64): method prompt_audio_tokenization (line 193) | def prompt_audio_tokenization(self, prompt_audios_list: list[torch.Ten... method get_spk_emb (line 208) | def get_spk_emb(self, prompt_audios_list: list[torch.Tensor]) -> torch... method get_prompt_mels (line 220) | def get_prompt_mels(self, prompt_audios_list: list[torch.Tensor], prom... method forward_flow (line 236) | def forward_flow(self, prompt_speech_tokens_list: list[list[int]], gen... method forward_hift (line 257) | def forward_hift(self, generated_mels: torch.Tensor, generated_mels_le... method forward (line 267) | def forward( function collate_fn (line 287) | def collate_fn(batch): function get_args (line 299) | def get_args(): FILE: runtime/triton_trtllm/token2wav_cosyvoice3.py function convert_onnx_to_trt (line 31) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, fp16, autocas... class TrtContextWrapper (line 73) | class TrtContextWrapper: method __init__ (line 74) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 85) | def acquire_estimator(self): method release_estimator (line 88) | def release_estimator(self, context, stream): class CosyVoice3_Token2Wav (line 92) | class CosyVoice3_Token2Wav(torch.nn.Module): method __init__ (line 93) | def __init__(self, model_dir, enable_trt=False, device_id=0, autocast_... method load_trt (line 140) | def load_trt(self, model_dir, trt_concurrent=1): method get_trt_kwargs (line 162) | def get_trt_kwargs(self): method load_spk_trt (line 173) | def load_spk_trt(self, model_dir, trt_concurrent=1, fp16=False): method get_spk_trt_kwargs (line 185) | def get_spk_trt_kwargs(self): method forward_spk_embedding (line 193) | def forward_spk_embedding(self, spk_feat): method prompt_audio_tokenization (line 219) | def prompt_audio_tokenization(self, prompt_audios_list): method get_spk_emb (line 234) | def get_spk_emb(self, prompt_audios_list): method get_prompt_mels (line 245) | def get_prompt_mels(self, prompt_audios_list, prompt_audios_sample_rate): method forward_flow (line 263) | def forward_flow(self, prompt_speech_tokens_list, generated_speech_tok... method forward_hift (line 296) | def forward_hift(self, generated_mels_list): method forward_stream (line 304) | def forward_stream(self, generated_speech_tokens, prompt_speech_tokens, method forward (line 379) | def forward(self, generated_speech_tokens_list, prompt_audios_list, FILE: tools/extract_embedding.py function single_job (line 24) | def single_job(utt): function main (line 37) | def main(args): FILE: tools/extract_speech_token.py function single_job (line 26) | def single_job(utt): function main (line 43) | def main(args): FILE: tools/make_parquet_list.py function job (line 26) | def job(utt_list, parquet_file, utt2parquet_file, spk2parquet_file): FILE: vllm_example.py function cosyvoice2_example (line 12) | def cosyvoice2_example(): function cosyvoice3_example (line 22) | def cosyvoice3_example(): function main (line 33) | def main(): FILE: webui.py function generate_seed (line 38) | def generate_seed(): function change_instruction (line 46) | def change_instruction(mode_checkbox_group): function generate_audio (line 50) | def generate_audio(tts_text, mode_checkbox_group, sft_dropdown, prompt_t... function main (line 118) | def main():