espnet2.speechlm.tokenizer.beats_tokenizer.BeatsTokenizer
Less than 1 minute
espnet2.speechlm.tokenizer.beats_tokenizer.BeatsTokenizer
class espnet2.speechlm.tokenizer.beats_tokenizer.BeatsTokenizer(beats_tokenizer_ckpt_path: str | None = None, tokenizer_config: Dict | None = None, max_layer: int | None = None, use_weighted_representation: bool = False, fbank_mean: float = 15.41663, fbank_std: float = 6.55582)
Bases: BeatsEncoder
Initializes internal Module state, shared by both nn.Module and ScriptModule.
encode(xs_pad: Tensor, ilens: Tensor | None = None)
reload_pretrained_parameters()
Initialization function for Beats.
This must be called last in the initialization procedure. The initialization occurs in three steps:
- ESPnet initializes all modules.
- This function initializes Beats encoder overriding 1.
- Optionally, if we have the pretrained checkpoint, we load the
weights from the checkpoint overriding 2 and 1.