code: def add_adapter(self, peft_cfgs: Union[PEFTConfig, List[PEFTConfig]]):
      if not isinstance(peft_cfgs, List):
          peft_cfgs = [peft_cfgs]
  
      self.base_keys = getattr(self, "base_keys", self._get_all_keys())
      logging.info(f"Before adding PEFT params:\n{self.summarize()}")
  
      self.use_ptuning_only = len(peft_cfgs) == 1 and isinstance(
          peft_cfgs[0], PtuningPEFTConfig
      )
  
      for peft_cfg in peft_cfgs:
          if self.use_ptuning_only:
              if not self.first_stage_of_pipeline():
                  # There are no params to add if we are not in the first state of the pipeline
                  continue
              self.virtual_tokens = peft_cfg.virtual_tokens
  
          self._check_and_add_peft_cfg(peft_cfg)
  
      logging.info(f"After adding PEFT params:\n{self.summarize()}")
      self.adapter_keys = self._get_all_keys() - self.base_keys
      if self.megatron_amp_O2:
          self.adapter_keys = set(
              key.replace("model.module.", "model.", 1)
              for key in self.adapter_keys
          )
  
      for cfg in peft_cfgs:
          if cfg.weight_tying:
              self.tie_weights(cfg)
      self.use_peft = True
  
file_path: NeMo/nemo/collections/nlp/parts/mixins/multimodal_adapter_mixins.py
imports: import os
  import tempfile
  from typing import List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.parts.mixins.nlp_adapter_mixins import NLPAdapterModelMixin
  from nemo.collections.nlp.parts.peft_config import PEFT_CONFIG_MAP, CanonicalAdaptersPEFTConfig, LoraPEFTConfig, PEFTConfig, PtuningPEFTConfig
  from nemo.core.classes.mixins.adapter_mixins import AdapterModuleMixin
  from nemo.core.connectors.save_restore_connector import SaveRestoreConnector
  from nemo.utils import logging, model_utils
  from nemo.utils.model_utils import inject_model_parallel_rank
label_desc: Use image node_id 3 for calling the MultimodalAdapterModelMixin obj's underlying member method code with example usage: obj.add_adapter(peft_cfgs) without return types