code: def auto_select_model(model_name):
      try:
          try:
              model = AutoModelForCausalLM.from_pretrained(
                  model_path,
                  low_cpu_mem_usage=True,
                  torch_dtype="auto",
                  trust_remote_code=True,
                  use_cache=True,
              )
          except:
              model = AutoModel.from_pretrained(
                  model_path,
                  low_cpu_mem_usage=True,
                  torch_dtype="auto",
                  trust_remote_code=True,
                  use_cache=True,
              )
      except:
          print(
              "Sorry, the model you entered is not supported in installer."
          )
          sys.exit()
  
      return model
  
file_path: BigDL/python/llm/portable-zip/chat.py
imports: import torch
  import argparse
  import sys
  from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer, AutoConfig
  from transformers import TextIteratorStreamer
  from transformers.tools.agents import StopSequenceCriteria
  from transformers.generation.stopping_criteria import StoppingCriteriaList
  from colorama import Fore
  from bigdl.llm import optimize_model
  from kv_cache import StartRecentKVCache
label_desc: Use image node_id 8 for calling a global function with example usage: auto_select_model(model_name) and returns: model