code: def get_model(model_config: ModelConfig) -> nn.Module:
      model_class = _get_model_architecture(model_config.hf_config)
  
      # Get the quantization config.
      quant_config = None
      if model_config.quantization is not None:
          invalidInputError(
              f"Quantization is not supported for {model_class}."
          )
  
      with _set_default_torch_dtype(model_config.dtype):
          # Create a model instance.
          # The weights will be initialized as empty tensors.
          if model_class in _MODEL_CLASSES_SUPPORT_QUANTIZATION:
              model = model_class(model_config.hf_config, quant_config)
          else:
              model = model_class(
                  model_config.hf_config,
                  device=model_config.device,
                  max_model_len=model_config.max_model_len,
              )
          # Load the weights from the cached or downloaded files.
          model.load_weights(
              model_config.model,
              model_config.download_dir,
              model_config.load_format,
              model_config.revision,
          )
          # bigdl-llm Intel specified code change
          # bigdl-llm change start
          # summary: Only use cuda when device is gpu.
          if model_config.device == "gpu":
              model = model.cuda()
          # bigdl-llm change end
      return model.eval()
  
file_path: BigDL/python/llm/src/bigdl/llm/vllm/model_executor/model_loader.py
imports: import contextlib
  from typing import Type
  import torch
  import torch.nn
  from transformers import PretrainedConfig
  from bigdl.llm.vllm.config import ModelConfig
  from bigdl.llm.vllm.model_executor.models.bigdl_llama import BigDLLlamaForCausalLM
  from bigdl.llm.vllm.model_executor.models.bigdl_mixtral import BigDLMixtralForCausalLM
  from bigdl.llm.vllm.model_executor.models.bigdl_mistral import BigDLMistralForCausalLM
  from bigdl.llm.vllm.model_executor.models.bigdl_chatglm import BigDLChatGLMForCausalLM
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 3 for calling a global function with example usage: get_model(model_config) and returns: model