MCPcopy Create free account

hub / github.com/FunAudioLLM/ThinkSound / functions

Functions638 in github.com/FunAudioLLM/ThinkSound

↓ 18 callersMethod__init__
(self, dim, output_dim)
ThinkSound/models/conditioners.py:160
↓ 17 callersFunctioncheckpoint
(function, *args, **kwargs)
ThinkSound/models/local_attention.py:9
↓ 13 callersMethod__init__
Initialize the FeedForward module. Args: dim (int): Input dimension. hidden_dim (int): Hidden dimension of t
ThinkSound/models/blocks.py:353
↓ 13 callersMethod__init__
(self)
ThinkSound/models/diffusion.py:20
↓ 13 callersMethoddecode
(self, x)
ThinkSound/models/bottleneck.py:19
↓ 11 callersMethodencode
(self, x, return_info=False, **kwargs)
ThinkSound/models/bottleneck.py:16
↓ 11 callersMethodload_state_dict
(self, sd: Mapping[str, Any], strict: bool = True)
data_utils/ext/synchformer/synchformer.py:37
↓ 11 callersMethodtrain
(self, mode: bool)
data_utils/v2a_utils/feature_utils_224.py:101
↓ 10 callersMethod__init__
(self, is_discrete: bool = False)
ThinkSound/models/bottleneck.py:11
↓ 9 callersMethod__init__
( self, dim_in, dim_out, activation: Callable, use_conv = False,
ThinkSound/models/transformer.py:197
↓ 9 callersFunctionload_ckpt_state_dict
(ckpt_path, prefix=None)
ThinkSound/models/utils.py:7
↓ 9 callersMethodload_state_dict
(self, state_dict, strict=True)
ThinkSound/models/pretransforms.py:89
↓ 9 callersMethodsum
(x)
ThinkSound/training/losses/auraloss.py:68
↓ 8 callersMethod__init__
(self, in_channels, out_channels, dilation, use_snake=False, antialias_activation=False)
ThinkSound/models/autoencoders.py:40
↓ 8 callersFunctioncreate_model_from_config
(model_config)
ThinkSound/models/factory.py:3
↓ 8 callersMethodtick
(self, msg)
ThinkSound/training/diffusion.py:33
↓ 7 callersMethod__init__
( self, fft_size: int = 1024, hop_size: int = 256, win_length: int = 1024,
ThinkSound/training/losses/auraloss.py:270
↓ 7 callersMethodget_conditioning_inputs
(self, conditioning_tensors: tp.Dict[str, tp.Any], negative=False)
ThinkSound/models/diffusion.py:132
↓ 6 callersMethod__init__
(self, n_samples, randomize=True)
ThinkSound/data/utils.py:10
↓ 6 callersFunctioncreate_pretransform_from_config
(pretransform_config, sample_rate)
ThinkSound/models/factory.py:35
↓ 6 callersMethoddecode
(self, latents, iterate_batch=False, **kwargs)
ThinkSound/models/autoencoders.py:321
↓ 6 callersFunctionget_activation
(activation: Literal["elu", "snake", "none"], antialias=False, channels=None)
ThinkSound/models/autoencoders.py:24
↓ 5 callersMethod__init__
(self, key_a: str, key_b: str, weight: float = 1.0, mask_key: str = None, name: str = 'l1_loss')
ThinkSound/training/losses/losses.py:26
↓ 5 callersMethod__init__
(self, enable_grad, io_channels, is_discrete)
ThinkSound/models/pretransforms.py:6
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None
data_utils/ext/synchformer/vit_helper.py:191
↓ 5 callersMethodcompile
(self)
data_utils/v2a_utils/feature_utils_224.py:93
↓ 5 callersMethodpre_attention
( self, x: torch.Tensor, rot: Optional[torch.Tensor])
ThinkSound/models/transformer_layers.py:63
↓ 5 callersFunctionsample
Draws samples from a model given starting noise. v-diffusion
ThinkSound/inference/sampling.py:48
↓ 5 callersFunctionsample_discrete_euler
Draws samples from a model given starting noise. Euler method
ThinkSound/inference/sampling.py:25
↓ 4 callersMethod__init__
( self, configs, sample_size=65536, sample_rate=48000, keywords=Non
ThinkSound/data/dataset.py:354
↓ 4 callersMethod__init__
( self, in_channels, out_channels, embed_dims = [96, 192, 384, 768], h
ThinkSound/models/local_attention.py:190
↓ 4 callersMethod__init__
(self, n_q: int, group_by: int = 2)
ThinkSound/models/codebook_patterns.py:535
↓ 4 callersMethod__init__
(self, dim: int, nhead: int, mlp_ratio: float = 4.0, pre_only: bool = False)
ThinkSound/models/transformer_layers.py:213
↓ 4 callersMethod__init__
( self, extract_features: bool = False, ckpt_path: str = None, factorize_space
data_utils/ext/synchformer/motionformer.py:46
↓ 4 callersFunctionattention
(q: torch.Tensor, k: torch.Tensor, v: torch.Tensor)
ThinkSound/models/transformer_layers.py:24
↓ 4 callersMethodpost_attention
(self, x: torch.Tensor, attn_out: torch.Tensor, c: tuple[torch.Tensor], context=None)
ThinkSound/models/transformer_layers.py:185
↓ 3 callersMethod_load_to_cuda
(self, model)
extract_latents.py:88
↓ 3 callersFunctioncompute_mean_kernel
(x, y)
ThinkSound/models/bottleneck.py:82
↓ 3 callersFunctioncopy_state_dict
Load state_dict to model, but only for keys that match exactly. Args: model (nn.Module): model to load state_dict. state_dict (Or
ThinkSound/models/utils.py:167
↓ 3 callersFunctioncreate_optimizer_from_config
Create optimizer from config. Args: parameters (iterable): parameters to optimize. optimizer_config (dict): optimizer config.
ThinkSound/training/utils.py:97
↓ 3 callersFunctioncreate_scheduler_from_config
Create scheduler from config. Args: scheduler_config (dict): scheduler config. optimizer (torch.optim.Optimizer): optimizer.
ThinkSound/training/utils.py:118
↓ 3 callersMethoddecode
(self, z)
ThinkSound/models/pretransforms.py:19
↓ 3 callersMethoddevice
(self)
ThinkSound/models/mmdit.py:516
↓ 3 callersMethodencode
(self, x)
ThinkSound/models/pretransforms.py:16
↓ 3 callersMethodforward
x is of shape (B, S, C, T, H, W) where S is the number of segments.
data_utils/ext/synchformer/motionformer.py:198
↓ 3 callersFunctionget_alphas_sigmas
Returns the scaling factors for the clean image (alpha) and for the noise (sigma), given a timestep.
ThinkSound/inference/sampling.py:8
↓ 3 callersFunctionget_configs
(audio_configs)
ThinkSound/data/datamodule.py:7
↓ 3 callersFunctionmodulate
(x: torch.Tensor, shift: torch.Tensor, scale: torch.Tensor)
ThinkSound/models/transformer_layers.py:20
↓ 3 callersFunctionremove_weight_norm_from_model
(model)
ThinkSound/models/utils.py:18
↓ 3 callersFunctionsafe_cat
(tensor1, tensor2, dim=0, match_dim=1)
ThinkSound/models/mmdit.py:568
↓ 3 callersMethodsample
(self, idx: int)
data_utils/v2a_utils/vggsound.py:100
↓ 3 callersFunctionvae_sample
(mean, scale)
ThinkSound/models/bottleneck.py:51
↓ 2 callersMethod__init__
(self)
ThinkSound/training/diffusion.py:30
↓ 2 callersMethod_build_reverted_sequence_scatter_indexes
Builds scatter indexes required to retrieve the original multi-codebook sequence from interleaving pattern. Args: sequenc
ThinkSound/models/codebook_patterns.py:178
↓ 2 callersMethod_forward
( self, x, t, mask=None, cross_attn_cond=None, cross_attn_c
ThinkSound/models/dit.py:157
↓ 2 callersFunctionapply_rope
(x: Tensor, rot: Tensor)
ThinkSound/models/embeddings.py:35
↓ 2 callersFunctionapply_rotary_pos_emb
(t, freqs, scale = 1)
ThinkSound/models/transformer.py:152
↓ 2 callersFunctioncheck_if_file_exists_else_download
Checks if file exists, if not downloads it from the link to the path
data_utils/ext/synchformer/utils.py:67
↓ 2 callersFunctioncompute_direction
(w, x, y, z)
ThinkSound/training/losses/auraloss.py:17
↓ 2 callersFunctioncompute_rope_rotations
(length: int, dim: int, theta: int,
ThinkSound/models/embeddings.py:16
↓ 2 callersFunctioncreate_autoencoder_from_config
(config: Dict[str, Any])
ThinkSound/models/autoencoders.py:693
↓ 2 callersFunctioncreate_bottleneck_from_config
(bottleneck_config)
ThinkSound/models/factory.py:87
↓ 2 callersFunctioncreate_decoder_from_config
(decoder_config: Dict[str, Any])
ThinkSound/models/autoencoders.py:657
↓ 2 callersFunctioncreate_encoder_from_config
(encoder_config: Dict[str, Any])
ThinkSound/models/autoencoders.py:617
↓ 2 callersFunctioncreate_training_wrapper_from_config
(model_config, model)
ThinkSound/training/factory.py:5
↓ 2 callersMethodcumsum
(sequence)
ThinkSound/data/dataset.py:563
↓ 2 callersMethodencode
(self, audio, return_info=False, skip_pretransform=False, iterate_batch=False, **kwargs)
ThinkSound/models/autoencoders.py:275
↓ 2 callersMethodencode_t5_text
(self, text: list[str])
data_utils/v2a_utils/feature_utils_224.py:160
↓ 2 callersMethodencode_text
(self, text_list)
extract_latents.py:111
↓ 2 callersFunctionexpand_to_planes
(input, shape)
ThinkSound/models/blocks.py:95
↓ 2 callersFunctionfast_scandir
very fast `glob` alternative. from https://stackoverflow.com/a/59803793/4259243
ThinkSound/data/dataset.py:28
↓ 2 callersMethodforward
(self, x)
ThinkSound/models/blocks.py:381
↓ 2 callersMethodforward_from_seq_len
(self, seq_len)
ThinkSound/models/transformer.py:120
↓ 2 callersFunctiongenerate_diffusion_cond
Generate audio from a prompt using a diffusion model. Args: model: The diffusion model to use for generation. steps: The
ThinkSound/inference/generation.py:11
↓ 2 callersFunctionget_bmask
(i, steps, mask)
ThinkSound/inference/sampling.py:90
↓ 2 callersMethodget_clap_features
(self, prompts, layer_ix=-2, device: tp.Any = "cuda")
ThinkSound/models/conditioners.py:406
↓ 2 callersMethodget_empty_clip_sequence
(self, bs: int)
ThinkSound/models/mmdit.py:477
↓ 2 callersMethodget_empty_string_sequence
(self, bs: int)
ThinkSound/models/mmdit.py:471
↓ 2 callersMethodget_empty_sync_sequence
(self, bs: int)
ThinkSound/models/mmdit.py:480
↓ 2 callersMethodinitialize_rotations
(self)
ThinkSound/models/mmdit.py:200
↓ 2 callersFunctionload_file
(filename, info, latent_length)
predict.py:62
↓ 2 callersFunctionmake_cond_model_fn
(model, cond_fn)
ThinkSound/inference/sampling.py:96
↓ 2 callersFunctionmultinomial
torch.multinomial with arbitrary number of dimensions, and number of candidates on the last dimension. Args: input (torch.Tensor): The in
ThinkSound/models/utils.py:29
↓ 2 callersFunctionnormalize
(x, eps=1e-4)
ThinkSound/models/blocks.py:223
↓ 2 callersFunctionpatch_clip
(clip_model)
ThinkSound/models/conditioners.py:587
↓ 2 callersFunctionprepare_audio
(audio, in_sr, target_sr, target_length, target_channels, device)
ThinkSound/inference/utils.py:17
↓ 2 callersMethodpreprocess_conditions
cache computations that do not depend on the latent/time step i.e., the features are reused over steps during inference
ThinkSound/models/mmdit.py:260
↓ 2 callersFunctionqkv_attn
(q, k, v, tok_mask: torch.Tensor = None)
data_utils/ext/synchformer/vit_helper.py:24
↓ 2 callersMethodrandom_mask
(self, sequence, max_mask_length)
ThinkSound/training/diffusion.py:410
↓ 2 callersFunctionresample
9s video_feat: [B, 72, D] audio_latent: [B, D', 194] or int
ThinkSound/models/utils.py:135
↓ 2 callersFunctionrms_norm
(x, scale, eps)
ThinkSound/models/blocks.py:203
↓ 2 callersFunctionrun_infer
(stage, duration_sec, videos_dir, csv_path, results_dir, cwd, use_half=False)
app.py:12
↓ 2 callersFunctionset_audio_channels
(audio, target_channels)
ThinkSound/inference/utils.py:5
↓ 2 callersMethodstft
Perform STFT. Args: x (Tensor): Input signal tensor (B, T). Returns: Tensor: x_mag, x_phs Mag
ThinkSound/training/losses/auraloss.py:366
↓ 2 callersMethodtick
(self, msg)
ThinkSound/models/diffusion.py:23
↓ 1 callersFunctionDownsample1d_2
( in_channels: int, out_channels: int, factor: int, kernel_multiplier: int = 2 )
ThinkSound/models/blocks.py:154
↓ 1 callersFunctionUpsample1d_2
( in_channels: int, out_channels: int, factor: int, use_nearest: bool = False )
ThinkSound/models/blocks.py:168
↓ 1 callersMethod__init__
( self, demo_dl, demo_every=2000, sample_size=65536, sample_rate=480
ThinkSound/training/autoencoders.py:394
↓ 1 callersMethod_build_flattened_codebooks
Build a flattened codebooks representation as a dictionary of inner step and the actual codebook indices corresponding to the flattened codebo
ThinkSound/models/codebook_patterns.py:434
↓ 1 callersMethod_build_pattern_sequence_scatter_indexes
Build scatter indexes corresponding to the pattern, up to the provided sequence_steps. Args: timesteps (int): Maximum number of t
ThinkSound/models/codebook_patterns.py:117
next →1–100 of 638, ranked by callers