MCPcopy Create free account

hub / github.com/boson-ai/higgs-audio / functions

Functions316 in github.com/boson-ai/higgs-audio

↓ 30 callersFunctioncount_parameters
(model, trainable_only=True)
boson_multimodal/model/higgs_audio/utils.py:19
↓ 14 callersMethodencode
Encode given audio data and return quantized latent codes Parameters ---------- audio_data : Tensor[B x 1 x T] Au
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/dac.py:214
↓ 13 callersMethoddecode
Decode given latent codes and return audio data Parameters ---------- z : Tensor[B x D x T] Quantized continuous
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/dac.py:252
↓ 9 callersFunctionWNConv1d
(*args, **kwargs)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/layers.py:9
↓ 8 callersFunctionis_distributed
()
boson_multimodal/audio_processing/quantization/distrib.py:28
↓ 7 callersMethod__init__
( self, in_channels: int, out_channels: int, kernel_size: int, stride:
boson_multimodal/audio_processing/semantic_module.py:17
↓ 7 callersFunctionis_deepspeed_ulysses_enabled
()
boson_multimodal/model/higgs_audio/utils.py:436
↓ 6 callersMethodload
(cls, path)
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/base.py:47
↓ 5 callersMethod__init__
( self, encoder_dim: int = 64, encoder_rates: List[int] = [2, 4, 8, 8], latent
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/dac.py:153
↓ 4 callersFunctionbroadcast_tensors
Broadcast the tensors from the given parameters to all workers. This can be used to ensure that all workers have the same model to start with.
boson_multimodal/audio_processing/quantization/distrib.py:57
↓ 4 callersMethoddecode
(self, embed_ind)
boson_multimodal/audio_processing/quantization/core_vq.py:194
↓ 3 callersMethod__init__
(self, config: HiggsAudioConfig)
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:815
↓ 3 callersFunction_drop_tokens
Divide a tensor among the sequence parallel ranks
boson_multimodal/model/higgs_audio/utils.py:632
↓ 3 callersFunction_gather_tokens
Gather tensors and concatenate them along a dimension
boson_multimodal/model/higgs_audio/utils.py:609
↓ 3 callersFunction_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_length)`,
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:110
↓ 3 callersFunctionbuild_delay_pattern_mask
Implement the delay pattern proposed in "Simple and Controllable Music Generation", https://arxiv.org/pdf/2306.05284 In the delay pattern, each c
boson_multimodal/model/higgs_audio/utils.py:26
↓ 3 callersMethoddecode
(self, embed_ind)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:248
↓ 3 callersFunctionload_higgs_audio_tokenizer
(tokenizer_name_or_path, device="cuda")
boson_multimodal/audio_processing/higgs_audio_tokenizer.py:312
↓ 3 callersFunctionprepare_chatml_sample
Preprocess the ChatML sample to get the tokens for the text part. Args: sample (ChatMLSample): The ChatML sample to preprocess. t
boson_multimodal/dataset/chatml_dataset.py:307
↓ 3 callersMethodpush
Push the given symbol on the stream, flushing out bits if possible. Args: symbol (int): symbol to encode with the AC.
boson_multimodal/audio_processing/quantization/ac.py:130
↓ 3 callersMethodput
Receives tokens and processes them as either text or audio tokens. For text tokens, decodes and caches them until complete words are
boson_multimodal/serve/serve_engine.py:100
↓ 3 callersFunctionworld_size
()
boson_multimodal/audio_processing/quantization/distrib.py:21
↓ 2 callersMethod__init__
(self, audio_codes)
boson_multimodal/audio_processing/higgs_audio_tokenizer.py:25
↓ 2 callersMethod__init__
( self, dim: int, codebook_size: int, kmeans_init: int = False, kmeans
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:148
↓ 2 callersMethod__init__
( self, dim: int, codebook_size: int, kmeans_init: int = False, kmeans
boson_multimodal/audio_processing/quantization/core_vq.py:112
↓ 2 callersMethod_embed_audio_ids
Embed the audio ids Args: audio_ids: torch.LongTensor of shape (num_codebooks, audio_in_total_length) Returns:
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:918
↓ 2 callersFunction_gather_tensors
Gather tensors and concatenate them along a dimension.
boson_multimodal/model/higgs_audio/utils.py:530
↓ 2 callersMethod_prepare_inputs
(self, chat_ml_sample: ChatMLSample, force_audio_gen: bool = False)
boson_multimodal/serve/serve_engine.py:280
↓ 2 callersMethod_prepare_kv_cache
Prepare the KV cache for the current sequence length.
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1467
↓ 2 callersMethod_prepare_kv_caches
(self)
boson_multimodal/serve/serve_engine.py:337
↓ 2 callersFunctionall_reduce
(tensor: torch.Tensor, op=torch.distributed.ReduceOp.SUM)
boson_multimodal/audio_processing/quantization/distrib.py:32
↓ 2 callersFunctionbuild_stable_quantized_cdf
Turn the given PDF into a quantized CDF that splits [0, 2 ** self.total_range_bits - 1] into chunks of size roughly proportional to the PDF.
boson_multimodal/audio_processing/quantization/ac.py:18
↓ 2 callersFunctioncalc_utt_length
(_text: str)
boson_multimodal/serve/utils.py:99
↓ 2 callersMethodcapture_model
Capture CUDA graphs for the model's forward pass with different KV cache lengths. Args: past_key_values: List of KV caches to cap
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:2242
↓ 2 callersMethoddecode_code
(self, embed_id)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/quantize.py:73
↓ 2 callersMethoddecode_latents
(self, latents)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/quantize.py:76
↓ 2 callersMethoddequantize
(self, embed_ind)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:234
↓ 2 callersMethoddequantize
(self, embed_ind)
boson_multimodal/audio_processing/quantization/core_vq.py:180
↓ 2 callersFunctionema_inplace
(moving_avg, new, decay: float)
boson_multimodal/audio_processing/quantization/core_vq.py:48
↓ 2 callersMethodencode
(self, x)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:238
↓ 2 callersMethodencode
(self, x)
boson_multimodal/audio_processing/quantization/core_vq.py:184
↓ 2 callersMethodget_audio_codes
(self, idx)
boson_multimodal/dataset/chatml_dataset.py:51
↓ 2 callersMethodget_audio_codes_labels
(self, idx)
boson_multimodal/dataset/chatml_dataset.py:60
↓ 2 callersMethodget_bandwidth_per_quantizer
Return bandwidth per quantizer for a given input sample rate.
boson_multimodal/audio_processing/quantization/vq.py:100
↓ 2 callersMethodget_num_quantizers_for_bandwidth
Return n_q based on specified target bandwidth.
boson_multimodal/audio_processing/quantization/vq.py:92
↓ 2 callersMethodget_output_length
(self, input_length)
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/base.py:104
↓ 2 callersMethodget_regress_target
(self, x)
boson_multimodal/audio_processing/higgs_audio_tokenizer.py:164
↓ 2 callersMethodget_wv
(self, idx)
boson_multimodal/dataset/chatml_dataset.py:71
↓ 2 callersMethodpostprocess_emb
(self, embed_ind, shape)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:231
↓ 2 callersMethodpostprocess_emb
(self, embed_ind, shape)
boson_multimodal/audio_processing/quantization/core_vq.py:177
↓ 2 callersMethodpreprocess
(self, x)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:221
↓ 2 callersMethodpreprocess
(self, x)
boson_multimodal/audio_processing/quantization/core_vq.py:167
↓ 2 callersMethodpreprocess
(self, audio_data, sample_rate)
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/dac.py:203
↓ 2 callersMethodpull
Pull a symbol, reading as many bits from the stream as required. This returns `None` when the stream has been exhausted. Args:
boson_multimodal/audio_processing/quantization/ac.py:217
↓ 2 callersMethodquantize
(self, x)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:225
↓ 2 callersMethodquantize
(self, x)
boson_multimodal/audio_processing/quantization/core_vq.py:171
↓ 2 callersFunctionrevert_delay_pattern
Convert samples encoded with delay pattern back to the original form. Args: data (:obj:`torch.Tensor`): The data with delay p
boson_multimodal/model/higgs_audio/utils.py:91
↓ 2 callersFunctionsample_vectors
(samples, num: int)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:72
↓ 2 callersFunctionsample_vectors
(samples, num: int)
boson_multimodal/audio_processing/quantization/core_vq.py:62
↓ 1 callersFunctionWNConvTranspose1d
(*args, **kwargs)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/layers.py:13
↓ 1 callersMethod__init__
( self, text_config=None, audio_encoder_config=None, audio_tokenizer_config=No
boson_multimodal/model/higgs_audio/configuration_higgs_audio.py:118
↓ 1 callersMethod__init__
:param original_linear: The original nn.Linear layer. :param freeze_until_idx: The index up to which the rows of the weight matrix ar
boson_multimodal/model/higgs_audio/custom_modules.py:99
↓ 1 callersMethod__init__
(self, input_dim: int, codebook_size: int, codebook_dim: int)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/quantize.py:25
↓ 1 callersMethod_apply_audio_tower
Apply the audio tower to the audio features
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:939
↓ 1 callersFunction_build_system_message_with_audio_prompt
(system_message)
examples/generation.py:160
↓ 1 callersFunction_ceil_to_nearest
(n, round_to)
boson_multimodal/data_collator/higgs_audio_collator.py:15
↓ 1 callersFunction_ceil_to_nearest
(n, round_to)
boson_multimodal/model/higgs_audio/utils.py:15
↓ 1 callersFunction_check_number_of_params
(params: tp.List[torch.Tensor])
boson_multimodal/audio_processing/quantization/distrib.py:41
↓ 1 callersMethod_copy_kv_cache
(self, from_cache: Cache, to_cache: Cache)
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1454
↓ 1 callersMethod_flush_common_prefix
(self)
boson_multimodal/audio_processing/quantization/ac.py:111
↓ 1 callersMethod_flush_common_prefix
(self)
boson_multimodal/audio_processing/quantization/ac.py:201
↓ 1 callersMethod_get_feat_extract_output_lengths
Computes the output length of the convolutional layers and the output length of the audio encoder
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:353
↓ 1 callersMethod_init_static_kv_cache
(self)
examples/generation.py:242
↓ 1 callersFunction_is_complex_or_float
(tensor)
boson_multimodal/audio_processing/quantization/distrib.py:37
↓ 1 callersMethod_prepare_all_static_kv_cache_masks
(self, hidden_states, attention_mask, audio_out_mask, past_key_values)
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1051
↓ 1 callersMethod_prepare_kv_caches
(self)
examples/generation.py:263
↓ 1 callersMethod_process_and_duplicate_audio_tokens
Process long audio and duplicate corresponding audio tokens. Args: input_ids: Input token ids audio_idx: Index of the
boson_multimodal/data_collator/higgs_audio_collator.py:109
↓ 1 callersMethod_sample_audio_tokens
Sample audio tokens and its corresponding text tokens from the logits
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1490
↓ 1 callersMethod_sample_text_tokens
Sample text tokens from the logits
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1577
↓ 1 callersFunction_scatter_tensors
Scatter tensors.
boson_multimodal/model/higgs_audio/utils.py:548
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:985
↓ 1 callersMethod_update_model_kwargs_for_generation
Update the model kwargs for each step.
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:1420
↓ 1 callersFunction_whisper_encoder_zero_shape_forward
The whisper encoder does not support zero-shape tensor by default due to the following implementations key_states = self._shape(self.k_proj(c
boson_multimodal/model/higgs_audio/modeling_higgs_audio.py:53
↓ 1 callersMethod_xcodec_encode
(self, x: torch.Tensor, target_bw: Optional[int] = None)
boson_multimodal/audio_processing/higgs_audio_tokenizer.py:263
↓ 1 callersMethodbackward
(ctx, grad_output)
boson_multimodal/audio_processing/quantization/ddp_utils.py:50
↓ 1 callersMethodcapture
( self, hidden_states: torch.Tensor, causal_mask: torch.Tensor, position_ids:
boson_multimodal/model/higgs_audio/cuda_graph_runner.py:27
↓ 1 callersMethodcompress
Processes an audio signal from a file or AudioSignal object into discrete codes. This function processes the signal in short windows,
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/base.py:122
↓ 1 callersFunctionconvert_nan_to_none
(obj)
boson_multimodal/dataset/chatml_dataset.py:327
↓ 1 callersMethoddecompress
Reconstruct audio from a given .dac file Parameters ---------- obj : Union[str, Path, DACFile] .dac file location
boson_multimodal/audio_processing/descriptaudiocodec/dac/model/base.py:230
↓ 1 callersFunctiondefault
(val: tp.Any, d: tp.Any)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:54
↓ 1 callersFunctiondefault
(val: tp.Any, d: tp.Any)
boson_multimodal/audio_processing/quantization/core_vq.py:44
↓ 1 callersMethodembed_code
(self, embed_id)
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/quantize.py:70
↓ 1 callersFunctionencode_base64_content_from_file
Encode a content from a local file to base64 format.
examples/serve_engine/input_samples.py:6
↓ 1 callersFunctionencode_base64_content_from_file
Encode a content from a local file to base64 format.
examples/vllm/run_chat_completion.py:26
↓ 1 callersMethodend
Flushes any remaining text tokens and signals the end of generation.
boson_multimodal/serve/serve_engine.py:128
↓ 1 callersMethodexpire_codes_
(self, batch_samples)
boson_multimodal/audio_processing/quantization/core_vq_lsx_version.py:204
↓ 1 callersMethodexpire_codes_
(self, batch_samples)
boson_multimodal/audio_processing/quantization/core_vq.py:155
↓ 1 callersMethodflush
Flush the remaining information to the stream.
boson_multimodal/audio_processing/quantization/ac.py:160
↓ 1 callersMethodfrom_codes
Given the quantized codes, reconstruct the continuous representation Parameters ---------- codes : Tensor[B x N x T]
boson_multimodal/audio_processing/descriptaudiocodec/dac/nn/quantize.py:191
↓ 1 callersMethodgenerate
( self, messages, audio_ids, chunked_text, generation_chunk_buffer_siz
examples/generation.py:268
next →1–100 of 316, ranked by callers