code: def get_conditioner_provider(
      output_dim: int, cfg: omegaconf.DictConfig
  ) -> ConditioningProvider:
      """Instantiate a conditioning model."""
      device = cfg.device
      duration = cfg.dataset.segment_duration
      cfg = getattr(cfg, "conditioners")
      dict_cfg = {} if cfg is None else dict_from_config(cfg)
      conditioners: tp.Dict[str, BaseConditioner] = {}
      condition_provider_args = dict_cfg.pop("args", {})
      condition_provider_args.pop("merge_text_conditions_p", None)
      condition_provider_args.pop("drop_desc_p", None)
  
      for cond, cond_cfg in dict_cfg.items():
          model_type = cond_cfg["model"]
          model_args = cond_cfg[model_type]
          if model_type == "t5":
              conditioners[str(cond)] = T5Conditioner(
                  output_dim=output_dim, device=device, **model_args
              )
          elif model_type == "lut":
              conditioners[str(cond)] = LUTConditioner(
                  output_dim=output_dim, **model_args
              )
          elif model_type == "chroma_stem":
              conditioners[str(cond)] = ChromaStemConditioner(
                  output_dim=output_dim,
                  duration=duration,
                  device=device,
                  **model_args,
              )
          elif model_type == "clap":
              conditioners[str(cond)] = CLAPEmbeddingConditioner(
                  output_dim=output_dim, device=device, **model_args
              )
          else:
              raise ValueError(
                  f"Unrecognized conditioning model: {model_type}"
              )
      conditioner = ConditioningProvider(
          conditioners, device=device, **condition_provider_args
      )
      return conditioner
  
imports: import typing
  import audiocraft
  import omegaconf
  import torch
  from .encodec import CompressionModel, EncodecModel, InterleaveStereoCompressionModel
  from .lm import LMModel
  from .lm_magnet import MagnetLMModel
  from ..modules.codebooks_patterns import CodebooksPatternProvider, DelayedPatternProvider, MusicLMPattern, ParallelPatternProvider, UnrolledPatternProvider, CoarseFirstPattern
  from ..modules.conditioners import BaseConditioner, ChromaStemConditioner, CLAPEmbeddingConditioner, ConditionFuser, ConditioningProvider, LUTConditioner, T5Conditioner
  from .unet import DiffusionUnet
  from ..None import quantization
  from ..utils.utils import dict_from_config
  from ..modules.diffusion_schedule import MultiBandProcessor, SampleProcessor
label_desc: Use image node_id 5 for calling a global function with example usage: get_conditioner_provider(output_dim, cfg) and returns: conditioner