code: def check_qlora_merge_and_unload_compatibility(
      config: "ModelConfig",
  ) -> None:  # noqa: F821
      """Checks that model.merge_and_unload() is supported by underlying model.save_pretrained() when merging QLoRA
      layers."""
      if (
          config.model_type != MODEL_LLM
          or config.trainer.type == "none"
      ):
          return
  
      if not (
          config.adapter
          and config.adapter.type in ["lora", "adalora"]
          and config.adapter.postprocessor
          and config.adapter.postprocessor.merge_adapter_into_base_model
          and config.quantization
      ):
          return
  
      if (
          config.quantization.bits
          < MIN_QUANTIZATION_BITS_FOR_MERGE_AND_UNLOAD
      ):
          raise ConfigValidationError(
              f"""This operation will entail merging LoRA layers on a {config.quantization.bits}-bit \
  quantized model.  Calling "save_pretrained()" on that model is currently unsupported.  If you want to merge the LoRA \
  adapter weights into the base model, you need to use 8-bit quantization or do non-quantized based training by removing \
  the quantization section from your Ludwig configuration."""
          )
  
imports: from abc import ABC, abstractmethod
  from re import findall
  from typing import Callable, TYPE_CHECKING
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BINARY, CATEGORY, IMAGE, IN_MEMORY, MIN_QUANTIZATION_BITS_FOR_MERGE_AND_UNLOAD, MODEL_ECD, MODEL_GBM, MODEL_LLM, NUMBER, SEQUENCE, SET, TEXT, TIMESERIES, VECTOR
  from ludwig.error import ConfigValidationError
  from ludwig.utils.metric_utils import get_feature_to_metric_names_map_from_feature_collection
  from ludwig.utils.misc_utils import merge_dict
label_desc: Use image node_id 34 for calling a global function with example usage: check_qlora_merge_and_unload_compatibility(config) without return types