code: def _create_new_module(
      create_new_module_func,
      lora_config,
      adapter_name,
      target,
      **kwargs,
  ):
      if isinstance(target, LowBitLinear) or isinstance(
          target, BF16Linear
      ):
          low_bit_kwargs = kwargs.copy()
          bias = low_bit_kwargs.pop("bias", False)
  
          if (
              hasattr(lora_config, "training_mode")
              and lora_config.training_mode == "lora"
          ):
              new_module = LoraBF16Linear(
                  adapter_name,
                  target.in_features,
                  target.out_features,
                  bias=bias,
                  **low_bit_kwargs,
              )
          else:
              if hasattr(lora_config, "training_mode"):
                  qa_lora = lora_config.training_mode == "qalora"
              else:
                  qa_lora = False
              low_bit_kwargs.update(
                  {"qtype": target.qtype, "qa_lora": qa_lora}
              )
              new_module = LoraLowBitLinear(
                  adapter_name,
                  target.in_features,
                  target.out_features,
                  bias=bias,
                  **low_bit_kwargs,
              )
      else:
          new_module = create_new_module_func(
              lora_config, adapter_name, target, **kwargs
          )
  
      return new_module
  
imports: import torch
  from torch.nn import Linear, Embedding
  from bigdl.llm.transformers.low_bit_linear import LowBitLinear, BF16Linear, get_qk_size
  from peft.tuners.lora import LoraLayer
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.transformers.utils import get_autocast_dtype
  from bigdl.llm.ggml.quantize import ggml_tensor_qtype
  import functools
  from bigdl.llm.transformers import training_patch
  from peft.tuners.lora import LoraModel
  from peft.tuners.lora import LoraConfig
  from dataclasses import dataclass, field
  from peft.mapping import PEFT_TYPE_TO_CONFIG_MAPPING
label_desc: Use image node_id 1 for calling a global function with example usage: _create_new_module(create_new_module_func, lora_config, adapter_name, target) and returns: new_module