code: def patch_fastchat():
      global is_fastchat_patched
      if is_fastchat_patched:
          return
      register_model_adapter(BigDLLMLOWBITAdapter)
      register_model_adapter(BigDLLLMAdapter)
      mapping_fastchat = _get_patch_map()
  
      for mapping_iter in mapping_fastchat:
          if mapping_iter[3] is None:
              mapping_iter[3] = getattr(
                  mapping_iter[0], mapping_iter[1], None
              )
          setattr(mapping_iter[0], mapping_iter[1], mapping_iter[2])
  
      is_fastchat_patched = True
  
imports: from fastchat.model.model_adapter import register_model_adapter, BaseModelAdapter, ChatGLMAdapter
  from fastchat.modules.gptq import GptqConfig, load_gptq_quantized
  import accelerate
  from fastchat.modules.awq import AWQConfig, load_awq_quantized
  from fastchat.model.model_adapter import get_model_adapter, raise_warning_for_incompatible_cpu_offloading_configuration
  from fastchat.model.monkey_patch_non_inplace import replace_llama_attn_with_non_inplace_operations
  from fastchat.constants import CPU_ISA
  from fastchat.utils import get_gpu_memory
  import torch
  import warnings
  from transformers import AutoTokenizer
  from typing import Dict, List, Optional
  import math
  import psutil
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 5 for calling a global function with example usage: patch_fastchat() without return types