MCPcopy Create free account

hub / github.com/Stability-AI/stable-audio-tools / functions

Functions1,182 in github.com/Stability-AI/stable-audio-tools

↓ 2 callersFunctioncompute_metrics_from_embeddings
Compute FAD (and optionally CLAP score) from pre-extracted embeddings. Args: eval_embeddings: numpy array of embeddings (M, embeddin
stable_audio_tools/training/metrics/fad_metrics.py:612
↓ 2 callersFunctioncondense_prompt
(prompt)
stable_audio_tools/interface/interfaces/diffusion_cond.py:38
↓ 2 callersMethodcopy_params_from_model_to_ema
(self)
stable_audio_tools/training/ema.py:120
↓ 2 callersFunctioncreate_augmented_padding_mask
Augment padding mask by randomly extending the valid region to include silence. This helps the model learn to handle silence at the end of a
stable_audio_tools/training/utils.py:280
↓ 2 callersFunctioncreate_autoencoder_from_config
(config: Dict[str, Any])
stable_audio_tools/models/autoencoders.py:1218
↓ 2 callersFunctioncreate_bottleneck_from_config
(bottleneck_config)
stable_audio_tools/models/factory.py:92
↓ 2 callersFunctioncreate_decoder_from_config
(decoder_config: Dict[str, Any])
stable_audio_tools/models/autoencoders.py:1174
↓ 2 callersFunctioncreate_demo_callback_from_config
(model_config, **kwargs)
stable_audio_tools/training/factory.py:290
↓ 2 callersFunctioncreate_encoder_from_config
(encoder_config: Dict[str, Any])
stable_audio_tools/models/autoencoders.py:1126
↓ 2 callersFunctioncreate_loss_modules_from_bottleneck
(bottleneck, loss_config)
stable_audio_tools/training/autoencoders.py:1227
↓ 2 callersFunctioncreate_multi_conditioner_from_conditioning_config
Create a MultiConditioner from a conditioning config dictionary Args: config: the conditioning config dictionary device: the
stable_audio_tools/models/conditioners.py:1113
↓ 2 callersFunctiondct
Discrete Cosine Transform, Type II (a.k.a. the DCT) For the meaning of the parameter `norm`, see: https://docs.scipy.org/doc/scipy-0.14.
stable_audio_tools/models/transforms.py:213
↓ 2 callersFunctiondesign_kaiser_lowpass
Design a lowpass filter using the Kaiser window. Parameters ---------- angular_cutoff : float The angular frequency cuto
stable_audio_tools/models/pqmf.py:151
↓ 2 callersMethoddiff
(x)
stable_audio_tools/training/losses/auraloss.py:103
↓ 2 callersFunctiondisable_lora
Disable LoRA layers. If lora_index is None, disables all. If specified, disables only that index.
stable_audio_tools/models/lora/utils.py:28
↓ 2 callersMethoddpm_solver_1_step
(self, x, t, t_next, eps_cache=None)
stable_audio_tools/inference/k_diffusion/sampling.py:245
↓ 2 callersMethoddpm_solver_3_step
(self, x, t, t_next, r1=1 / 3, r2=2 / 3, eps_cache=None)
stable_audio_tools/inference/k_diffusion/sampling.py:262
↓ 2 callersFunctionenable_lora
Enable LoRA layers. If lora_index is None, enables all. If specified, enables only that index.
stable_audio_tools/models/lora/utils.py:20
↓ 2 callersMethodenable_lora
(self)
stable_audio_tools/models/lora/model.py:251
↓ 2 callersMethodencode
(self, audio, return_info=False, skip_pretransform=False, iterate_batch=False, return_pretransform = False, **
stable_audio_tools/models/autoencoders.py:829
↓ 2 callersMethodencode1d
( self, wave: Tensor, stacked: bool = True )
stable_audio_tools/models/adp.py:1556
↓ 2 callersFunctionexists
(val)
stable_audio_tools/training/optims.py:115
↓ 2 callersFunctionexpand_to_planes
(input, shape)
stable_audio_tools/models/blocks.py:180
↓ 2 callersFunctionfilter_lora_layers
Enable/disable LoRA layers by name filter. If lora_index is specified, only affects that index.
stable_audio_tools/models/lora/utils.py:51
↓ 2 callersFunctionfn
(tau)
stable_audio_tools/inference/k_diffusion/sampling.py:161
↓ 2 callersMethodfold
(self, x: torch.Tensor, n: int)
stable_audio_tools/models/discriminators.py:371
↓ 2 callersMethodforward
(self, x)
stable_audio_tools/models/discriminators.py:230
↓ 2 callersMethodforward
(self, reals: torch.Tensor, gens: torch.Tensor, checkpointing: bool = False)
stable_audio_tools/models/discriminators.py:844
↓ 2 callersMethodforward
(self, fake, real)
stable_audio_tools/models/discriminators.py:961
↓ 2 callersMethodforward
(self, x)
stable_audio_tools/models/discriminators.py:1227
↓ 2 callersMethodforward
(self, x)
stable_audio_tools/models/discriminators.py:1315
↓ 2 callersMethodgenerate_audio
Generate audio from a batch of codes
stable_audio_tools/models/lm.py:457
↓ 2 callersFunctiongenerate_diffusion_cond
Generate audio from a prompt using a diffusion model. Args: model: The diffusion model to use for generation. steps: The num
stable_audio_tools/inference/generation.py:85
↓ 2 callersFunctionget_activation
(activation: Literal["elu", "snake", "none"], antialias=False, channels=None)
stable_audio_tools/models/blocks.py:17
↓ 2 callersMethodget_channels
Gets context channels at `layer` and checks that shape is correct
stable_audio_tools/models/adp.py:1151
↓ 2 callersMethodget_clap_features
(self, prompts, layer_ix=-2, device: tp.Any = "cuda")
stable_audio_tools/models/conditioners.py:315
↓ 2 callersMethodget_current_decay
(self)
stable_audio_tools/training/ema.py:127
↓ 2 callersMethodget_disc_scores
(self, filtered_hidden_states)
stable_audio_tools/training/arc.py:806
↓ 2 callersFunctionget_extra_padding_for_conv1d
See `pad_for_conv1d`.
stable_audio_tools/models/adp.py:73
↓ 2 callersFunctionget_filter_bank
(wavelet)
stable_audio_tools/models/wavelets.py:11
↓ 2 callersFunctionget_padding
(kernel_size: int, dilation: int = 1)
stable_audio_tools/models/discriminators.py:1552
↓ 2 callersFunctionget_params_by_name
(model, print_shapes=False, name_filter=None)
stable_audio_tools/models/lora/utils.py:88
↓ 2 callersMethodget_pattern
(self, timesteps: int)
stable_audio_tools/models/codebook_patterns.py:539
↓ 2 callersFunctionget_pretrained_model
(name: str)
stable_audio_tools/models/pretrained.py:8
↓ 2 callersFunctionget_rank
Get rank of current process.
stable_audio_tools/training/utils.py:11
↓ 2 callersMethodget_scalings
(self, sigma)
stable_audio_tools/inference/k_diffusion/external.py:19
↓ 2 callersFunctionget_sigmoid_relgan_losses
(score_real, score_fake)
stable_audio_tools/models/discriminators.py:35
↓ 2 callersMethodget_text_features
(self, text, layer_ix=-2)
stable_audio_tools/models/clap.py:133
↓ 2 callersFunctiongroupby
(prefix: str, d: Dict, keep_prefix: bool = False)
stable_audio_tools/models/adp.py:58
↓ 2 callersFunctionhas_lora
Return True if the model has at least one LoRAParametrization on any weight.
stable_audio_tools/models/lora/utils.py:47
↓ 2 callersFunctionidct
The inverse to DCT-II, which is a scaled Discrete Cosine Transform, Type III Our definition of idct is that idct(dct(x)) == x For the m
stable_audio_tools/models/transforms.py:242
↓ 2 callersMethodindices_to_codes
(self, indices)
stable_audio_tools/models/fsq.py:102
↓ 2 callersFunctionis_silence
checks if entire clip is 'silence' below some dB threshold
stable_audio_tools/data/dataset.py:596
↓ 2 callersFunctionload_clap_model
Load and return a CLAP model. Select one of the following clap models from https://github.com/LAION-AI/CLAP: - music_speech_audioset
stable_audio_tools/training/metrics/fad_metrics.py:131
↓ 2 callersFunctionload_lora_checkpoint
Load a LoRA checkpoint from either .safetensors or .ckpt format. Returns: Tuple of (state_dict, lora_config) where lora_config may be an
stable_audio_tools/models/lora/utils.py:217
↓ 2 callersFunctionmake_cond_model_fn
(model, cond_fn)
stable_audio_tools/inference/sampling.py:636
↓ 2 callersFunctionmmd
Compute the MMD loss along a chosen feature axis by collapsing all other dimensions. Args: x: Tensor of arbitrary shape.
stable_audio_tools/training/losses/utils.py:60
↓ 2 callersFunctionnormalize
(x, eps=1e-4)
stable_audio_tools/models/blocks.py:308
↓ 2 callersFunctionpad1d
Tiny wrapper around F.pad, just to allow for reflect padding on small input. If this is the case, we insert extra 0 padding to the right before th
stable_audio_tools/models/adp.py:97
↓ 2 callersFunctionprepare_dora_state_dict
Squeeze 2D DoRA magnitude tensors to 1D for loading. Modifies in-place.
stable_audio_tools/models/lora/utils.py:174
↓ 2 callersFunctionproject_down
this projects to lower dimenions, grabbing the first _`proj_dims`_ dimensions
stable_audio_tools/interface/aeiou.py:36
↓ 2 callersFunctionremove_weight_norm_from_model
(model)
stable_audio_tools/models/utils.py:34
↓ 2 callersFunctionresolve_adapter_type
Resolve legacy "dora" adapter_type to the correct variant. If adapter_type is "dora" and a checkpoint state_dict is provided, attempts to det
stable_audio_tools/models/lora/utils.py:181
↓ 2 callersFunctionrms_norm
(x, scale, eps)
stable_audio_tools/models/blocks.py:288
↓ 2 callersFunctionround_ste
Round with straight through gradients.
stable_audio_tools/models/fsq.py:21
↓ 2 callersFunctionset_lora_strength
Set lora strength. If lora_index is None, sets all LoRAs. If specified, sets only that index.
stable_audio_tools/models/lora/model.py:451
↓ 2 callersMethodsigma_to_t
(self, sigma)
stable_audio_tools/inference/k_diffusion/external.py:25
↓ 2 callersFunctionslerp
Performs spherical interpolation with magnitude interpolation and calculates local velocity. Args: tensor1: First tensor of shap
stable_audio_tools/interface/interfaces/autoencoder.py:25
↓ 2 callersFunctionstrip_trailing_silence
Strip silence from the end of an audio tensor. Args: audio: tensor [channels, samples] sample_rate: audio sample rate thr
stable_audio_tools/data/utils.py:82
↓ 2 callersFunctionsync_non_fsdp_gradients
All-reduce gradients for non-FSDP trainable parameters. Call this after backward() but before optimizer.step() to ensure gradient synchr
stable_audio_tools/training/fsdp.py:54
↓ 2 callersFunctiont_to_alpha_sigma
Returns the scaling factors for the clean image and for the noise, given a timestep.
stable_audio_tools/inference/sampling.py:22
↓ 2 callersMethodtick
(self, msg)
stable_audio_tools/models/diffusion.py:25
↓ 2 callersFunctionunpad1d
Remove padding from x, handling properly zero padding. Only for 1d!
stable_audio_tools/models/adp.py:117
↓ 2 callersFunctionzeropower_via_newtonschulz5
Newton-Schulz iteration to compute the polar factor of G. Produces approximately U @ V^T where G = U @ S @ V^T is the SVD. Uses a quinti
stable_audio_tools/training/optims.py:199
↓ 1 callersFunctionDownsample1d_2
( in_channels: int, out_channels: int, factor: int, kernel_multiplier: int = 2 )
stable_audio_tools/models/blocks.py:239
↓ 1 callersFunctionFeedForward
(features: int, multiplier: int)
stable_audio_tools/models/adp.py:392
↓ 1 callersFunctionUpsample1d_2
( in_channels: int, out_channels: int, factor: int, use_nearest: bool = False )
stable_audio_tools/models/blocks.py:253
↓ 1 callersFunctionWNConvTranspose1d
(*args, **kwargs)
stable_audio_tools/models/convnext.py:9
↓ 1 callersMethod__init__
( self, demo_dl, demo_every=2000, sample_size=65536, sample_rate=44100
stable_audio_tools/training/autoencoders.py:1094
↓ 1 callersMethod__init__
( self, model: CLAP, lr: float = None, optimizer_configs: dict
stable_audio_tools/training/clap.py:167
↓ 1 callersMethod__init__
(self, demo_every=2000, num_demos=8, sample_size=65536,
stable_audio_tools/training/lm.py:183
↓ 1 callersMethod__init__
(self, channels, levels, wavelet: Literal["bior2.2", "bio
stable_audio_tools/models/wavelets.py:18
↓ 1 callersMethod__init__
(self, embed_dim: int, use_generation_cache=False, **kwargs)
stable_audio_tools/models/lm_backbone.py:10
↓ 1 callersMethod__init__
( self, pattern_provider: CodebooksPatternProvider, backbone: AudioLMBac
stable_audio_tools/models/lm.py:36
↓ 1 callersMethod_adamw_step
(self, group)
stable_audio_tools/training/optims.py:439
↓ 1 callersFunction_ath_db_spl
Absolute Threshold of Hearing in dB SPL (ISO 226:2003 approximation)
stable_audio_tools/models/psychoacoustics.py:21
↓ 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
stable_audio_tools/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
stable_audio_tools/models/codebook_patterns.py:117
↓ 1 callersFunction_build_spreading_function
(freqs: torch.Tensor, device, dtype)
stable_audio_tools/models/psychoacoustics.py:34
↓ 1 callersMethod_call_transformer
Helper method to call transformer and handle early exit logic.
stable_audio_tools/models/dit.py:154
↓ 1 callersMethod_codes_to_indices
(self, zhat)
stable_audio_tools/models/fsq.py:91
↓ 1 callersMethod_compute_cross_entropy
Compute cross entropy between multi-codebook targets and model's logits. The cross entropy is computed per codebook to provide codebook-level
stable_audio_tools/training/lm.py:81
↓ 1 callersMethod_compute_tonality_freq
(self, X: torch.Tensor)
stable_audio_tools/models/psychoacoustics.py:160
↓ 1 callersMethod_design_weighting_fir
(self, which: str)
stable_audio_tools/training/losses/auraloss.py:158
↓ 1 callersMethod_ema_filter
Vectorized exponential moving average
stable_audio_tools/models/psychoacoustics.py:189
↓ 1 callersFunction_from_mid_side
(x: torch.Tensor)
stable_audio_tools/models/pretransforms.py:178
↓ 1 callersMethod_generate_inpaint_demos
Generate inpainting demos from batch data with forced mask types.
stable_audio_tools/training/diffusion.py:1371
↓ 1 callersMethod_generate_prompt_demos
Generate full t2m demos from specified prompts (FULL_MASK).
stable_audio_tools/training/diffusion.py:1295
↓ 1 callersFunction_generate_random_spans_mask
Generate a mask with 1-N non-overlapping contiguous spans covering a target ratio. Samples a target mask ratio from U[mask_ratio_range], the
stable_audio_tools/models/inpainting.py:13
↓ 1 callersFunction_get_adapter_param_names
Return the list of trainable parameter names for this adapter type.
stable_audio_tools/models/lora/utils.py:294
← previousnext →201–300 of 1,182, ranked by callers