code: def init_adapters_config(
      model: PreTrainedModel,
      model_config: PretrainedConfig,
      adapters_config: Optional[ModelAdaptersConfig] = None,
  ):
      """Initializes the adapters config object of the model to enable adapter support. Also make required changes to the
      model's config.
  
          Args:
              model (PreTrainedModel): The model for which to add the adapters config.
              model_config (PretrainedConfig): The model's config.
              adapters_config (ModelAdaptersConfig): The adapters config to be added.
      """
      # Make sure config is wrapped
      model.config = model_config
      wrap_config(model.config)
  
      # Init ModelAdaptersConfig
      if adapters_config is not None:
          model.adapters_config = adapters_config
      elif not hasattr(model_config, "adapters"):
          model.adapters_config = ModelAdaptersConfig()
      elif model_config.adapters is not None and not isinstance(
          model_config.adapters, ModelAdaptersConfig
      ):
          model.adapters_config = ModelAdaptersConfig(
              **model_config.adapters
          )
  
      # Convert AdapterFusions from old format for backwards compatibility
      fusion_models = getattr(model_config, "adapter_fusion_models", [])
      fusion_config = getattr(model_config, "adapter_fusion", None)
      for fusion_adapter_names in fusion_models:
          model.adapters_config.add_fusion(
              fusion_adapter_names, config=fusion_config
          )
  
imports: import copy
  from typing import Optional
  from transformers import PreTrainedModel
  from transformers.configuration_utils import PretrainedConfig
  from ..configuration import ModelAdaptersConfig
label_desc: Use image node_id 1 for calling a global function with example usage: init_adapters_config(model, model_config, adapters_config) without return types