class_docstr: AudioGen main model with convenient generation API.
  
  Args:
      name (str): name of the model.
      compression_model (CompressionModel): Compression model
          used to map audio to invertible discrete representations.
      lm (LMModel): Language model over discrete representations.
      max_duration (float, optional): maximum duration the model can produce,
          otherwise, inferred from the training params.
docstr: Return pretrained model, we provide a single model for now:
  - facebook/audiogen-medium (1.5B), text to sound,
    # see: https://huggingface.co/facebook/audiogen-medium
code: def get_pretrained(
      name: str = "facebook/audiogen-medium", device=None
  ):
      """Return pretrained model, we provide a single model for now:
      - facebook/audiogen-medium (1.5B), text to sound,
        # see: https://huggingface.co/facebook/audiogen-medium
      """
      if device is None:
          if torch.cuda.device_count():
              device = "cuda"
          else:
              device = "cpu"
  
      if name == "debug":
          # used only for unit tests
          compression_model = get_debug_compression_model(
              device, sample_rate=16000
          )
          lm = get_debug_lm_model(device)
          return AudioGen(name, compression_model, lm, max_duration=10)
  
      compression_model = load_compression_model(name, device=device)
      lm = load_lm_model(name, device=device)
      assert (
          "self_wav" not in lm.condition_provider.conditioners
      ), "AudioGen do not support waveform conditioning for now"
      return AudioGen(name, compression_model, lm)
  
file_path: audiocraft/audiocraft/models/audiogen.py
imports: import typing
  import torch
  from .encodec import CompressionModel
  from .genmodel import BaseGenModel
  from .lm import LMModel
  from .builders import get_debug_compression_model, get_debug_lm_model
  from .loaders import load_compression_model, load_lm_model
label_desc: Use image node_id 2 for calling the AudioGen obj's underlying member method code with example usage: obj.get_pretrained(name, device) and returns: AudioGen, AudioGen