code: def get_config(
      model: str,
      trust_remote_code: bool,
      revision: Optional[str] = None,
  ) -> PretrainedConfig:
      # NOTE: Because the Mistral model in HF hub does not have
      # `configuration_mistral.py`, we cannot use `AutoConfig` to load the
      # config. Instead, we use `MistralConfig` directly.
      # NOTE: This is a hack. This does not work for local models.
      # FIXME: Remove this once the Mistral model is available in the stable
      # version of HF transformers.
      if "mistral" in model.lower():
          return MistralConfig.from_pretrained(model, revision=revision)
  
      try:
          config = AutoConfig.from_pretrained(
              model,
              trust_remote_code=trust_remote_code,
              revision=revision,
          )
      except ValueError as e:
          if (
              not trust_remote_code
              and "requires you to execute the configuration file"
              in str(e)
          ):
              err_msg = (
                  "Failed to load the model config. If the model is a custom "
                  "model not yet available in the HuggingFace transformers "
                  "library, consider setting `trust_remote_code=True` in LLM "
                  "or using the `--trust-remote-code` flag in the CLI."
              )
              invalidInputError(err_msg)
          else:
              invalidInputError(e)
      return config
  
imports: from typing import Optional
  import torch
  from transformers import AutoConfig, PretrainedConfig
  from bigdl.llm.vllm.logger import init_logger
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 3 for calling a global function with example usage: get_config(model, trust_remote_code, revision) and returns: config, MistralConfig