class_docstr: Takes a trained model and makes predictions on new data.
  
  This is a base class which handles some common boilerplate.
  It intentionally has an interface similar to ``Brain`` - these base
  classes handle similar things.
  
  Subclasses of Pretrained should implement the actual logic of how
  the pretrained system runs, and add methods with descriptive names
  (e.g. transcribe_file() for ASR).
  
  Pretrained is a torch.nn.Module so that methods like .to() or .eval() can
  work. Subclasses should provide a suitable forward() implementation: by
  convention, it should be a method that takes a batch of audio signals and
  runs the full model (as applicable).
  
  Arguments
  ---------
  modules : dict of str:torch.nn.Module pairs
      The Torch modules that make up the learned system. These can be treated
      in special ways (put on the right device, frozen, etc.). These are available
      as attributes under ``self.mods``, like self.mods.model(x)
  hparams : dict
      Each key:value pair should consist of a string key and a hyperparameter
      that is used within the overridden methods. These will
      be accessible via an ``hparams`` attribute, using "dot" notation:
      e.g., self.hparams.model(x).
  run_opts : dict
      Options parsed from command line. See ``speechbrain.parse_arguments()``.
      List that are supported here:
       * device
       * data_parallel_count
       * data_parallel_backend
       * distributed_launch
       * distributed_backend
       * jit
       * jit_module_keys
       * compule
       * compile_module_keys
       * compile_mode
       * compile_using_fullgraph
       * compile_using_dynamic_shape_tracing
  freeze_params : bool
      To freeze (requires_grad=False) parameters or not. Normally in inference
      you want to freeze the params. Also calls .eval() on all modules.
class_docstr_tok: ["Takes","a","trained","model","and","makes","predictions","on","new","data",".","This","is","a","base","class","which","handles","some","common","boilerplate",".","It","intentionally","has","an","interface","similar","to","``","Brain","``","-","these","base","classes","handle","similar","things",".","Subclasses","of","Pretrained","should","implement","the","actual","logic","of","how","the","pretrained","system","runs",",","and","add","methods","with","descriptive","names","(","e.g",".","transcribe_file","(",")","for","ASR",")",".","Pretrained","is","a","torch.nn.Module","so","that","methods","like",".to","(",")","or",".eval","(",")","can","work",".","Subclasses","should","provide","a","suitable","forward","(",")","implementation",":","by","convention",",","it","should","be","a","method","that","takes","a","batch","of","audio","signals","and","runs","the","full","model","(","as","applicable",")",".","Arguments","--","--","--","--","-","modules",":","dict","of","str",":","torch.nn.Module","pairs","The","Torch","modules","that","make","up","the","learned","system",".","These","can","be","treated","in","special","ways","(","put","on","the","right","device",",","frozen",",","etc.",")",".","These","are","available","as","attributes","under","``","self.mods","``",",","like","self.mods.model","(","x",")","hparams",":","dict","Each","key",":","value","pair","should","consist","of","a","string","key","and","a","hyperparameter","that","is","used","within","the","overridden","methods",".","These","will","be","accessible","via","an","``","hparams","``","attribute",",","using","``","dot","''","notation",":","e.g.",",","self.hparams.model","(","x",")",".","run_opts",":","dict","Options","parsed","from","command","line",".","See","``","speechbrain.parse_arguments","(",")","``",".","List","that","are","supported","here",":","*","device","*","data_parallel_count","*","data_parallel_backend","*","distributed_launch","*","distributed_backend","*","jit","*","jit_module_keys","*","compule","*","compile_module_keys","*","compile_mode","*","compile_using_fullgraph","*","compile_using_dynamic_shape_tracing","freeze_params",":","bool","To","freeze","(","requires_grad=False",")","parameters","or","not",".","Normally","in","inference","you","want","to","freeze","the","params",".","Also","calls",".eval","(",")","on","all","modules","."]
docstr: Load an audio file with this model's input spec
  
  When using a speech model, it is important to use the same type of data,
  as was used to train the model. This means for example using the same
  sampling rate and number of channels. It is, however, possible to
  convert a file from a higher sampling rate to a lower one (downsampling).
  Similarly, it is simple to downmix a stereo file to mono.
  The path can be a local path, a web url, or a link to a huggingface repo.
code: def load_audio(self, path, savedir="."):
      """Load an audio file with this model's input spec
  
      When using a speech model, it is important to use the same type of data,
      as was used to train the model. This means for example using the same
      sampling rate and number of channels. It is, however, possible to
      convert a file from a higher sampling rate to a lower one (downsampling).
      Similarly, it is simple to downmix a stereo file to mono.
      The path can be a local path, a web url, or a link to a huggingface repo.
      """
      source, fl = split_path(path)
      path = fetch(fl, source=source, savedir=savedir)
      signal, sr = torchaudio.load(str(path), channels_first=False)
      return self.audio_normalizer(signal, sr)
  
imports: import logging
  import hashlib
  import sys
  import warnings
  import torch
  import torchaudio
  from types import SimpleNamespace
  from torch.nn import SyncBatchNorm
  from torch.nn import DataParallel
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.fetching import fetch
  from speechbrain.dataio.preprocess import AudioNormalizer
  from torch.nn.parallel import DistributedDataParallel
  from speechbrain.utils.data_utils import split_path
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.dataio.batch import PaddedBatch, PaddedData
  from speechbrain.utils.data_pipeline import DataPipeline
  from speechbrain.utils.superpowers import import_from_path
label_desc: Use image node_id 3 for calling the Pretrained obj's underlying member method code with example usage: obj.load_audio(path, savedir) and returns: self