MCPcopy Create free account

hub / github.com/LAION-AI/natural_voice_assistant / functions

Functions135 in github.com/LAION-AI/natural_voice_assistant

↓ 10 callersMethod__init__
( self, in_channels: int, out_channels: int, kernel_size: int, stride:
models_voice_assistant/STT/conformer_encoder.py:907
↓ 7 callersMethodcall_LLM
Pass the given input to the LLM to either generate a new output or just update the key value cache If the input is a string, the toke
models_voice_assistant/stt_llm_tts_model.py:409
↓ 3 callersMethod__init__
Initialize the encoder, decoder and joint model of the Streaming STT FastConformer. Args: vocabulary_path: Valid file path to a .n
models_voice_assistant/stt_llm_tts_model.py:26
↓ 3 callersFunctionavoid_float16_autocast_context
If the current autocast context is float16, cast it to bfloat16 if available (unless we're in jit) or float32
models_voice_assistant/STT/conformer_encoder.py:2354
↓ 3 callersFunctionchange_dir
Temporarily change the working directory to the given path and change it back at the end Args: destination: global or local path
models_voice_assistant/TTS/style_tts2_model.py:170
↓ 3 callersMethodforward_qkv
Transforms query, key and value. Args: query (torch.Tensor): (batch, time1, size) key (torch.Tensor): (batch, time2, s
models_voice_assistant/STT/conformer_encoder.py:59
↓ 3 callersMethodjoint
(self, f: torch.Tensor, g: torch.Tensor)
models_voice_assistant/STT/rnnt_joint.py:230
↓ 3 callersMethodpredict
Stateful prediction of scores and state for a (possibly null) tokenset. This method takes various cases into consideration :
models_voice_assistant/STT/rnnt_decoder.py:172
↓ 3 callersMethodupdate_cache
(self, x, cache=None)
models_voice_assistant/STT/conformer_encoder.py:1006
↓ 2 callersMethod_chunk_overlap
Convert into overlapping chunks. Args: x (torch.Tensor): # (batch x head, time, size) w (int): Chunk overlap size
models_voice_assistant/STT/conformer_encoder.py:654
↓ 2 callersMethod_create_masks
(self, att_context_size, padding_length, max_audio_length, offset, device)
models_voice_assistant/STT/conformer_encoder.py:2080
↓ 2 callersFunctioncalc_length
Calculates the output length of a Tensor passed through a convolution or max pooling layer
models_voice_assistant/STT/conformer_encoder.py:2315
↓ 2 callersMethodcreate_pe
(self, positions)
models_voice_assistant/STT/conformer_encoder.py:825
↓ 2 callersMethoddetokenize
Resolve the given sequence of tokens to a text string Args: tokens: sequence of tokens Returns: string contain
models_voice_assistant/stt_llm_tts_model.py:289
↓ 2 callersMethodforward_attention
Compute attention context vector. Args: value (torch.Tensor): (batch, time2, size) scores(torch.Tensor): (batch, time1
models_voice_assistant/STT/conformer_encoder.py:80
↓ 2 callersMethodget_seq_len
(self, seq_len)
utils_voice_assistant/preprocessor.py:84
↓ 2 callersMethodlabel_collate
(self, labels, device=None)
models_voice_assistant/stt_llm_tts_model.py:98
↓ 2 callersMethodset_max_audio_length
Sets maximum input length. Pre-calculates internal seq_range mask.
models_voice_assistant/STT/conformer_encoder.py:2071
↓ 2 callersMethodsliding_chunks_matmul_pv
Same as sliding_chunks_matmul_qk but for prob and value tensors. Args: prob (torch.Tensor): (batch, head, time, size)
models_voice_assistant/STT/conformer_encoder.py:772
↓ 2 callersMethodsliding_chunks_matmul_qk
Matrix multiplication of query x key tensors using with a sliding window attention pattern. This implementation splits the input into overlapp
models_voice_assistant/STT/conformer_encoder.py:710
↓ 2 callersMethodstates_to_device
Maps the decoding state to the given device Args: dec_state: hidden state of the decoder model device: target device
models_voice_assistant/stt_llm_tts_model.py:84
↓ 1 callersMethod__init__
Returns an LSTM with forget gate bias init to `forget_gate_bias`. Args: input_size: See `torch.nn.LSTM`. hidden_size:
models_voice_assistant/STT/rnnt_decoder.py:29
↓ 1 callersMethod_calc_context_sizes
( self, att_context_size, att_context_probs, att_context_style, conv_context_size, conv_kernel_size
models_voice_assistant/STT/conformer_encoder.py:2136
↓ 1 callersMethod_compute_attn_output_with_global_indices
Compute the attention output with global indices. Args: value (torch.Tensor): (batch, head, time, head_dim) The value ve
models_voice_assistant/STT/conformer_encoder.py:496
↓ 1 callersMethod_compute_global_key_attn
( self, key: torch.Tensor, query: torch.Tensor, max_num_global_attn_indices: i
models_voice_assistant/STT/conformer_encoder.py:467
↓ 1 callersMethod_compute_out_global_to_all
Compute the attention output of global tokens attending to all. Args: query (torch.Tensor): (batch, head, time, head_dim
models_voice_assistant/STT/conformer_encoder.py:543
↓ 1 callersFunction_convert_config
(cfg: 'OmegaConf')
models_voice_assistant/STT/enc_dec_rnnt_model.py:69
↓ 1 callersMethod_get_global_attn_indices
Compute global attention indices. Args: is_index_global_attn (torch.Tensor): (batch, time) A boolean tensor indicating i
models_voice_assistant/STT/conformer_encoder.py:427
↓ 1 callersMethod_get_invalid_locations_mask
(self, w: int, device: str)
models_voice_assistant/STT/conformer_encoder.py:676
↓ 1 callersFunction_get_ngc_pretrained_model_info
(cloud_url, model_description)
utils_voice_assistant/nemo_loader.py:80
↓ 1 callersMethod_joint_net_modules
Prepare the trainable modules of the Joint Network Args: num_classes: Number of output classes (vocab size) excluding th
models_voice_assistant/STT/rnnt_joint.py:298
↓ 1 callersMethod_predict_modules
Prepare the trainable parameters of the Prediction Network. Args: vocab_size: Vocab size (excluding the blank token).
models_voice_assistant/STT/rnnt_decoder.py:268
↓ 1 callersMethod_skew
Convert diagonals into columns (or columns into diagonals depending on `direction` Args: x (torch.Tensor): (batch x head, chunk_c
models_voice_assistant/STT/conformer_encoder.py:619
↓ 1 callersMethod_skew2
Shift every row 1 step to right converting columns into diagonals Args: x (torch.Tensor): (batch x head, chunks_count + 1, w, 2w
models_voice_assistant/STT/conformer_encoder.py:635
↓ 1 callersFunction_unpack_nemo_file
(path2file: str, out_folder: str, extract_config_only: bool = False)
utils_voice_assistant/nemo_loader.py:92
↓ 1 callersMethodappend_processed_signal
(self, processed_signal, stream_id=-1)
utils_voice_assistant/streaming_buffer.py:88
↓ 1 callersMethodbatch_concat_states
(self, batch_states)
models_voice_assistant/stt_llm_tts_model.py:122
↓ 1 callersMethodbatch_select_state
(self, batch_states, idx)
models_voice_assistant/stt_llm_tts_model.py:112
↓ 1 callersMethodcall_STT
Pass the given audio signal to the STT to get a transcription Args: processed_signal: preprocessed audio chunk process
models_voice_assistant/stt_llm_tts_model.py:451
↓ 1 callersMethodchannel_chunked_conv
Performs channel chunked convolution
models_voice_assistant/STT/conformer_encoder.py:1703
↓ 1 callersFunctioncompute_stochastic_depth_drop_probs
( num_layers: int, stochastic_depth_drop_prob: float = 0.0, stochastic_depth_mode: str = "linear",
models_voice_assistant/STT/conformer_encoder.py:2327
↓ 1 callersMethodconv_split_by_batch
Tries to split input by batch, run conv and concat results
models_voice_assistant/STT/conformer_encoder.py:1653
↓ 1 callersMethodconv_split_by_channel
For dw convs, tries to split input by time, run conv and concat results
models_voice_assistant/STT/conformer_encoder.py:1673
↓ 1 callersMethoddecoder_step
Perform a single decoding step Args: label: previous predicted token hidden: hidden state after the last decoding ste
models_voice_assistant/stt_llm_tts_model.py:151
↓ 1 callersMethodextend_pe
Reset and extend the positional encodings if needed.
models_voice_assistant/STT/conformer_encoder.py:840
↓ 1 callersFunctionfind_supported_audio_format
Find supported sample rate and number of channels for a given audio device Args: audio: pyaudio instance device_inde
main.py:32
↓ 1 callersFunctionflush
Flush Cuda cache to prevent side effect and slowdowns
main.py:155
↓ 1 callersMethodforward
Syntehsize the entire text Args: text: String of text that should be synthesized Returns: synthesized audio d
models_voice_assistant/stt_llm_tts_model.py:349
↓ 1 callersMethodforward
( self, x, )
models_voice_assistant/STT/conformer_encoder.py:941
↓ 1 callersMethodforward_internal
( self, audio_signal, length, cache_last_channel=None, cache_last_time=None, cache_last_channel_len=No
models_voice_assistant/STT/conformer_encoder.py:1929
↓ 1 callersMethodfrom_config_dict
Instantiates object using DictConfig-based configuration
models_voice_assistant/STT/enc_dec_rnnt_model.py:50
↓ 1 callersMethodget_initial_cache_state
(self, batch_size=1, dtype=torch.float32, device=None, max_dim=0)
models_voice_assistant/STT/conformer_encoder.py:2282
↓ 1 callersMethodget_sampling_frames
(self)
models_voice_assistant/STT/conformer_encoder.py:1570
↓ 1 callersMethodget_streaming_cache_size
(self)
models_voice_assistant/STT/conformer_encoder.py:1573
↓ 1 callersMethodgreedy_RNNT_decode
Perform decoder and joint step for every encoded signal in the given audio chunk Args: encoder_output: encoded audio chunk contain
models_voice_assistant/stt_llm_tts_model.py:182
↓ 1 callersMethodhandle_stop_conditions
Check stopping conditions and decide if the current sentence or sequence should be returned Returns: end: Boolean value if sentenc
models_voice_assistant/stt_llm_tts_model.py:535
↓ 1 callersMethodhandle_transcription
Handle new transcription and decide if it should be passed to the LLM Args: transcribed_text: Transcription output from the STT. C
models_voice_assistant/stt_llm_tts_model.py:480
↓ 1 callersMethodinitialize_state
Initialize the state of the RNN layers, with same dtype and device as input `y`. Args: y: A torch.Tensor whose device th
models_voice_assistant/STT/rnnt_decoder.py:322
↓ 1 callersMethodjoint_after_projection
Compute the joint step of the network after projection. Here, B = Batch size T = Acoustic model timesteps U
models_voice_assistant/STT/rnnt_joint.py:239
↓ 1 callersMethodjoint_step
Perform a single joint step Args: enc: encoded audio signal pred: decoder output Returns: probabil
models_voice_assistant/stt_llm_tts_model.py:170
↓ 1 callersFunctionlabel_collate
Collates the label inputs for the rnn-t prediction network. If `labels` is already in torch.Tensor form this is a no-op. Args: labels
models_voice_assistant/STT/rnnt_decoder.py:349
↓ 1 callersFunctionlength_to_mask
(lengths)
models_voice_assistant/TTS/style_tts2_model.py:164
↓ 1 callersFunctionlist_pyaudio_devices
Print our all available audio devices and their index
main.py:97
↓ 1 callersFunctionload_config_and_state_dict
( _cls, restore_path: str, strict: bool = False, )
utils_voice_assistant/nemo_loader.py:114
↓ 1 callersFunctionload_rnnt_model
(cloud_url, model_description)
utils_voice_assistant/nemo_loader.py:161
↓ 1 callersFunctionmain
Start the recording process in the main thread and all other processes in a separate process.
main.py:259
↓ 1 callersMethodmask_invalid_locations
Mask locations invalid for the sliding window attention Args: input_tensor (torch.Tensor): # (batch x head, time, size)
models_voice_assistant/STT/conformer_encoder.py:690
↓ 1 callersFunctionmaybe_download_from_cloud
(url, filename, subfolder=None, cache_dir=None, refresh_cache=False)
utils_voice_assistant/nemo_loader.py:41
↓ 1 callersFunctionmaybe_update_config_version
(cfg: 'DictConfig')
models_voice_assistant/STT/enc_dec_rnnt_model.py:88
↓ 1 callersMethodproject_encoder
(self, encoder_output: torch.Tensor)
models_voice_assistant/STT/rnnt_joint.py:233
↓ 1 callersMethodproject_prednet
(self, prednet_output: torch.Tensor)
models_voice_assistant/STT/rnnt_joint.py:236
↓ 1 callersFunctionrecord
Record an audio stream from the microphone in a separate process Args: audio_buffer: multiprocessing queue to store the recorded
main.py:106
↓ 1 callersMethodrel_shift
(self, x)
models_voice_assistant/STT/conformer_encoder.py:157
↓ 1 callersMethodreset_buffer
(self)
utils_voice_assistant/streaming_buffer.py:109
↓ 1 callersMethodreset_sentence
Resets token buffer after end of sentence
models_voice_assistant/stt_llm_tts_model.py:513
↓ 1 callersMethodreset_sequence
Resets current sentence and current sequence after end of sequence. Helper variables are set to start a new sequence when the next word is tra
models_voice_assistant/stt_llm_tts_model.py:521
↓ 1 callersFunctionresolve_cache_dir
()
utils_voice_assistant/nemo_loader.py:33
↓ 1 callersFunctionrnn
( input_size: int, hidden_size: int, num_layers: int, norm: Optional[str] = None, forget_g
models_voice_assistant/STT/rnnt_decoder.py:376
↓ 1 callersMethodsetup_streaming_params
This function sets the needed values and parameters to perform streaming. The configuration would be stored in self.streaming_cfg.
models_voice_assistant/STT/conformer_encoder.py:2184
↓ 1 callersMethodtokenize
Resolve the given text into a sequence of tokens Args: text: string of arbitrary length Returns: Sequence of t
models_voice_assistant/stt_llm_tts_model.py:280
↓ 1 callersMethodtokens_to_text
Translate a sequence of predicted tokens to text Args: prediction: sequence of tokens Returns: A string contai
models_voice_assistant/stt_llm_tts_model.py:137
↓ 1 callersMethodupdate_cache
(self, key, value, query, cache)
models_voice_assistant/STT/conformer_encoder.py:131
↓ 1 callersMethodupdate_max_seq_length
(self, seq_length: int, device)
models_voice_assistant/STT/conformer_encoder.py:2058
Method__init__
( self, sample_rate=16000, window_size=0.025, window_stride=0.01, norm
utils_voice_assistant/preprocessor.py:28
Method__init__
(self, chunk_size=16,shift_size=16, device="cuda")
utils_voice_assistant/streaming_buffer.py:29
Method__init__
Initialized tokenizer and LLM model from huggingface Args: model_name: huggingface model descriptor Returns: I
models_voice_assistant/stt_llm_tts_model.py:256
Method__init__
Initialize STT model and perform warm up steps Args: Returns: Instance of TTS model
models_voice_assistant/stt_llm_tts_model.py:327
Method__init__
Initialize STT, LLM and TTS model and the state of the voice assistant Args: Returns: Instance of voice assistant model
models_voice_assistant/stt_llm_tts_model.py:363
Method__init__
Construct an MultiHeadedAttention object.
models_voice_assistant/STT/conformer_encoder.py:42
Method__init__
Construct an RelPositionMultiHeadedAttention object.
models_voice_assistant/STT/conformer_encoder.py:139
Method__init__
Construct an RelPositionMultiHeadAttentionLongformer object.
models_voice_assistant/STT/conformer_encoder.py:227
Method__init__
Construct an PositionalEncoding object.
models_voice_assistant/STT/conformer_encoder.py:813
Method__init__
( self, in_channels: int, out_channels: int, kernel_size: int, stride:
models_voice_assistant/STT/conformer_encoder.py:960
Method__init__
( self, d_model, kernel_size, norm_type='batch_norm', conv_context_size=None, pointwise_activation='gl
models_voice_assistant/STT/conformer_encoder.py:1030
Method__init__
(self, d_model, d_ff, dropout, activation=nn.SiLU())
models_voice_assistant/STT/conformer_encoder.py:1122
Method__init__
( self, d_model, d_ff, self_attention_model='rel_pos', global_tokens=0
models_voice_assistant/STT/conformer_encoder.py:1149
Method__init__
( self, subsampling, subsampling_factor, feat_in, feat_out, co
models_voice_assistant/STT/conformer_encoder.py:1268
Method__init__
( self, feat_in, n_layers, d_model, feat_out=-1, causal_downsa
models_voice_assistant/STT/conformer_encoder.py:1763
Method__init__
Initialize encoder, decoder and joint from given config
models_voice_assistant/STT/enc_dec_rnnt_model.py:31
Method__init__
( self, jointnet: Dict[str, Any], num_classes: int, num_extra_outputs: int = 0
models_voice_assistant/STT/rnnt_joint.py:28
next →1–100 of 135, ranked by callers