class_docstr: A ready-to-use Encoder ASR model
  
  The class can be used either to run only the encoder (encode()) to extract
  features or to run the entire encoder + decoder function model
  (transcribe()) to transcribe speech. The given YAML must contain the fields
  specified in the *_NEEDED[] lists.
  
  Example
  -------
  >>> from speechbrain.inference.ASR import EncoderASR
  >>> tmpdir = getfixture("tmpdir")
  >>> asr_model = EncoderASR.from_hparams(
  ...     source="speechbrain/asr-wav2vec2-commonvoice-fr",
  ...     savedir=tmpdir,
  ... ) # doctest: +SKIP
  >>> asr_model.transcribe_file("samples/audio_samples/example_fr.wav") # doctest: +SKIP
class_docstr_tok: ["A","ready-to-use","Encoder","ASR","model","The","class","can","be","used","either","to","run","only","the","encoder","(","encode","(",")",")","to","extract","features","or","to","run","the","entire","encoder","+","decoder","function","model","(","transcribe","(",")",")","to","transcribe","speech",".","The","given","YAML","must","contain","the","fields","specified","in","the","*","_NEEDED","[","]","lists",".","Example","--","--","--","-",">",">",">","from","speechbrain.inference.ASR","import","EncoderASR",">",">",">","tmpdir","=","getfixture","(","``","tmpdir","''",")",">",">",">","asr_model","=","EncoderASR.from_hparams","(","...","source=","''","speechbrain\/asr-wav2vec2-commonvoice-fr","''",",","...","savedir=tmpdir",",","...",")","#","doctest",":","+SKIP",">",">",">","asr_model.transcribe_file","(","``","samples\/audio_samples\/example_fr.wav","''",")","#","doctest",":","+SKIP"]
docstr: Transcribes the given audiofile into a sequence of words.
  
  Arguments
  ---------
  path : str
      Path to audio file which to transcribe.
  
  Returns
  -------
  str
      The audiofile transcription produced by this ASR system.
docstr_tok: ["Transcribes","the","given","audiofile","into","a","sequence","of","words",".","Arguments","--","--","--","--","-","path",":","str","Path","to","audio","file","which","to","transcribe",".","Returns","--","--","--","-","str","The","audiofile","transcription","produced","by","this","ASR","system","."]
code: def transcribe_file(self, path, **kwargs):
      """Transcribes the given audiofile into a sequence of words.
  
      Arguments
      ---------
      path : str
          Path to audio file which to transcribe.
  
      Returns
      -------
      str
          The audiofile transcription produced by this ASR system.
      """
      waveform = self.load_audio(path, **kwargs)
      # Fake a batch:
      batch = waveform.unsqueeze(0)
      rel_length = torch.tensor([1.0])
      predicted_words, predicted_tokens = self.transcribe_batch(
          batch, rel_length
      )
      return str(predicted_words[0])
  
imports: import torch
  import sentencepiece
  import speechbrain
  from speechbrain.inference.interfaces import Pretrained
  from speechbrain.utils.fetching import fetch
  from speechbrain.utils.data_utils import split_path
label_desc: Use image node_id 3 for calling the EncoderASR obj's underlying member method code with example usage: obj.transcribe_file(path) and returns: str