class_docstr: Data class that bundles associated information to use pretrained :py:class:`~torchaudio.models.Wav2Vec2Model` for forced alignment.
  
  This class provides interfaces for instantiating the pretrained model along with
  the information necessary to retrieve pretrained weights and additional data
  to be used with the model.
  
  Torchaudio library instantiates objects of this class, each of which represents
  a different pretrained model. Client code should access pretrained models via these
  instances.
  
  Please see below for the usage and the available values.
  
  Example - Feature Extraction
      >>> import torchaudio
      >>>
      >>> bundle = torchaudio.pipelines.MMS_FA
      >>>
      >>> # Build the model and load pretrained weight.
      >>> model = bundle.get_model()
      Downloading:
      100%|███████████████████████████████| 1.18G/1.18G [00:05<00:00, 216MB/s]
      >>>
      >>> # Resample audio to the expected sampling rate
      >>> waveform = torchaudio.functional.resample(waveform, sample_rate, bundle.sample_rate)
      >>>
      >>> # Estimate the probability of token distribution
      >>> emission, _ = model(waveform)
      >>>
      >>> # Generate frame-wise alignment
      >>> alignment, scores = torchaudio.functional.forced_align(
      >>>     emission, targets, input_lengths, target_lengths, blank=0)
      >>>
class_docstr_tok: ["Data","class","that","bundles","associated","information","to","use","pretrained",":","py",":","class",":","`","~torchaudio.models.Wav2Vec2Model","`","for","forced","alignment",".","This","class","provides","interfaces","for","instantiating","the","pretrained","model","along","with","the","information","necessary","to","retrieve","pretrained","weights","and","additional","data","to","be","used","with","the","model",".","Torchaudio","library","instantiates","objects","of","this","class",",","each","of","which","represents","a","different","pretrained","model",".","Client","code","should","access","pretrained","models","via","these","instances",".","Please","see","below","for","the","usage","and","the","available","values",".","Example","-","Feature","Extraction",">",">",">","import","torchaudio",">",">",">",">",">",">","bundle","=","torchaudio.pipelines.MMS_FA",">",">",">",">",">",">","#","Build","the","model","and","load","pretrained","weight",".",">",">",">","model","=","bundle.get_model","(",")","Downloading",":","100","%","|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588|","1.18G\/1.18G","[","00:05","<","00:00",",","216MB\/s","]",">",">",">",">",">",">","#","Resample","audio","to","the","expected","sampling","rate",">",">",">","waveform","=","torchaudio.functional.resample","(","waveform",",","sample_rate",",","bundle.sample_rate",")",">",">",">",">",">",">","#","Estimate","the","probability","of","token","distribution",">",">",">","emission",",","_","=","model","(","waveform",")",">",">",">",">",">",">","#","Generate","frame-wise","alignment",">",">",">","alignment",",","scores","=","torchaudio.functional.forced_align","(",">",">",">","emission",",","targets",",","input_lengths",",","target_lengths",",","blank=0",")",">",">",">"]
docstr: Construct the model and load the pretrained weight.
  
  The weight file is downloaded from the internet and cached with
  :func:`torch.hub.load_state_dict_from_url`
  
  Args:
      with_star (bool, optional): If enabled, the last dimension of output layer is
          extended by one, which corresponds to `star` token.
      dl_kwargs (dictionary of keyword arguments): Passed to :func:`torch.hub.load_state_dict_from_url`.
  
  Returns:
      Variation of :py:class:`~torchaudio.models.Wav2Vec2Model`.
  
      .. note::
  
         The model created with this method returns probability in log-domain,
         (i.e. :py:func:`torch.nn.functional.log_softmax` is applied), whereas
         the other Wav2Vec2 models returns logit.
docstr_tok: ["Construct","the","model","and","load","the","pretrained","weight",".","The","weight","file","is","downloaded","from","the","internet","and","cached","with",":","func",":","`","torch.hub.load_state_dict_from_url","`","Args",":","with_star","(","bool",",","optional",")",":","If","enabled",",","the","last","dimension","of","output","layer","is","extended","by","one",",","which","corresponds","to","`","star","`","token",".","dl_kwargs","(","dictionary","of","keyword","arguments",")",":","Passed","to",":","func",":","`","torch.hub.load_state_dict_from_url","`",".","Returns",":","Variation","of",":","py",":","class",":","`","~torchaudio.models.Wav2Vec2Model","`",".","..","note",":",":","The","model","created","with","this","method","returns","probability","in","log-domain",",","(","i.e",".",":","py",":","func",":","`","torch.nn.functional.log_softmax","`","is","applied",")",",","whereas","the","other","Wav2Vec2","models","returns","logit","."]
code: def get_model(
      self, with_star: bool = True, *, dl_kwargs=None
  ) -> Module:
      """Construct the model and load the pretrained weight.
  
      The weight file is downloaded from the internet and cached with
      :func:`torch.hub.load_state_dict_from_url`
  
      Args:
          with_star (bool, optional): If enabled, the last dimension of output layer is
              extended by one, which corresponds to `star` token.
          dl_kwargs (dictionary of keyword arguments): Passed to :func:`torch.hub.load_state_dict_from_url`.
  
      Returns:
          Variation of :py:class:`~torchaudio.models.Wav2Vec2Model`.
  
          .. note::
  
             The model created with this method returns probability in log-domain,
             (i.e. :py:func:`torch.nn.functional.log_softmax` is applied), whereas
             the other Wav2Vec2 models returns logit.
      """
      model = utils._get_model(self._model_type, self._params)
      state_dict = utils._get_state_dict(
          self._path, dl_kwargs, self._remove_aux_axis
      )
      model.load_state_dict(state_dict)
      model = utils._extend_model(
          model,
          normalize_waveform=self._normalize_waveform,
          apply_log_softmax=True,
          append_star=with_star,
      )
      model.eval()
      return model
  
file_path: audio/src/torchaudio/pipelines/_wav2vec2/impl.py
imports: from dataclasses import dataclass
  from typing import Any, Dict, Optional, Tuple
  from torch.nn import Module
  from .None import aligner, utils
label_desc: Use image node_id 2 for calling the Wav2Vec2FABundle obj's underlying member method code with example usage: obj.get_model(with_star) and returns: model