code: def __init__(
      self,
      config,
      device: Optional[str] = None,
      max_model_len: Optional[int] = None,
  ):
      super().__init__(config, device, max_model_len)
      self.config = config
      # TODO(gc): later change this to a switch?
      if True:
          from bigdl.llm.transformers import AutoModelForCausalLM
          from bigdl.llm import optimize_model
  
      # low_bit = 'sym_int4'
      if device == "cpu":
          model = AutoModelForCausalLM.from_pretrained(
              config._name_or_path,
              low_cpu_mem_usage=True,
              trust_remote_code=True,
              use_cache=True,
          )
          self.model = optimize_model(model)
          self.sampler = BigDLSampler(config.vocab_size, device)
      elif device == "xpu":
          try:
              import intel_extension_for_pytorch as ipex
          except ImportError:
              print(
                  "Intel Extension for PyTorch is not installed, \
                         but is required for xpu inference."
              )
  
          low_bit = "sym_int4"
          model = AutoModelForCausalLM.from_pretrained(
              config._name_or_path,
              load_in_low_bit=low_bit,
              trust_remote_code=True,
              optimize_model=True,
              use_cache=True,
          )
          self.model = model.to("xpu")
          self.sampler = BigDLSampler(config.vocab_size, device).to(
              "xpu"
          )
  
      if device is None:
          self.device = torch.device(
              "cuda" if torch.cuda.is_available() else "cpu"
          )
      else:
          self.device = torch.device(device)
      self.dtype = self.model.dtype
      self.last_seq_ids = []
      self.tmp_kv_cache = None
      if config.pad_token_id is None:
          self.pad_token_id = config.eos_token_id
      else:
          self.pad_token_id = config.pad_token_id
      self.max_seq_limit = max_model_len
  
file_path: BigDL/python/llm/src/bigdl/llm/vllm/model_executor/models/bigdl_mixtral.py
imports: import torch
  from torch import nn
  from transformers import AutoTokenizer, PreTrainedTokenizerBase, LlamaConfig
  from typing import Optional, Tuple, List, Type, Dict
  from bigdl.llm.vllm.sequence import SequenceOutputs, SequenceGroupMetadata
  from bigdl.llm.vllm.model_executor.layers.bigdl_sampler import BigDLSampler
  from bigdl.llm.vllm.model_executor.models.bigdl_model import BigDLModelForCausalLM
  from bigdl.llm.vllm.logger import init_logger
  import math
  import time
  from bigdl.llm.vllm.model_executor.input_metadata import InputMetadata
  from transformers.generation.logits_process import LogitsProcessorList, RepetitionPenaltyLogitsProcessor, TemperatureLogitsWarper, TopKLogitsWarper, TopPLogitsWarper
label_desc: Use image node_id 1 to create a new BigDLMixtralForCausalLM object from inherited base classes: BigDLModelForCausalLM with example: obj = BigDLMixtralForCausalLM(config, device, max_model_len)