code: def update_model_config_to_support_adapter(model_cfg):
      with open_dict(model_cfg):
          adapter_metadata = adapter_mixins.get_registered_adapter(
              model_cfg.encoder._target_
          )
          if adapter_metadata is not None:
              model_cfg.encoder._target_ = (
                  adapter_metadata.adapter_class_path
              )
  
      return model_cfg
  
imports: import os
  from math import ceil
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from omegaconf import DictConfig, open_dict
  from pytorch_lightning import Trainer
  from torch.nn import Linear
  from tqdm import tqdm
  from nemo.collections.common.losses.cross_entropy import CrossEntropyLoss
  from nemo.collections.nlp.models.token_classification.punctuation_capitalization_model import PunctuationCapitalizationModel
  from nemo.collections.nlp.modules.common.transformer import TransformerDecoder
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.core.classes.mixins import adapter_mixins
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: update_model_config_to_support_adapter(model_cfg) and returns: model_cfg