class_docstr: A generic model class that mimics the behavior of
  ``transformers.LlamaForCausalLM.from_pretrained`` API
class_docstr_tok: ["A","generic","model","class","that","mimics","the","behavior","of","``","transformers.LlamaForCausalLM.from_pretrained","``","API"]
docstr: :param pretrained_model_name_or_path: Path for converted BigDL-LLM optimized ggml
         binary checkpoint. The checkpoint should be converted by ``bigdl.llm.llm_convert``.
  :param model_family: The model family of the pretrained checkpoint.
         Currently we support ``"llama"``, ``"bloom"``, ``"gptneox"``, ``"starcoder"``
         and ``"chatglm"``.
  :param dtype: Which quantized precision will be converted.
          Now only `int4` and `int8` are supported, and `int8` only works for `llama`
          , `gptneox` and `starcoder`.
  :param cache_dir: (optional) This parameter will only be used when
         ``pretrained_model_name_or_path`` is a huggingface checkpoint or hub repo id.
         It indicates the saving path for the converted low precision model.
  :param tmp_path: (optional) Which path to store the intermediate fp16 model during the
         conversion process. Default to `None` so that intermediate model will not be saved.
  :param kwargs: keyword arguments which will be passed to the model instance
  
  :return: a model instance
docstr_tok: [":","param","pretrained_model_name_or_path",":","Path","for","converted","BigDL-LLM","optimized","ggml","binary","checkpoint",".","The","checkpoint","should","be","converted","by","``","bigdl.llm.llm_convert","``",".",":","param","model_family",":","The","model","family","of","the","pretrained","checkpoint",".","Currently","we","support","``","``","llama","''","``",",","``","``","bloom","''","``",",","``","``","gptneox","''","``",",","``","``","starcoder","''","``","and","``","``","chatglm","''","``",".",":","param","dtype",":","Which","quantized","precision","will","be","converted",".","Now","only","`","int4","`","and","`","int8","`","are","supported",",","and","`","int8","`","only","works","for","`","llama","`",",","`","gptneox","`","and","`","starcoder","`",".",":","param","cache_dir",":","(","optional",")","This","parameter","will","only","be","used","when","``","pretrained_model_name_or_path","``","is","a","huggingface","checkpoint","or","hub","repo","id",".","It","indicates","the","saving","path","for","the","converted","low","precision","model",".",":","param","tmp_path",":","(","optional",")","Which","path","to","store","the","intermediate","fp16","model","during","the","conversion","process",".","Default","to","`","None","`","so","that","intermediate","model","will","not","be","saved",".",":","param","kwargs",":","keyword","arguments","which","will","be","passed","to","the","model","instance",":","return",":","a","model","instance"]
code: def from_pretrained(
      cls,
      pretrained_model_name_or_path: str,
      model_family: str = "llama",
      dtype: str = "int4",
      **kwargs,
  ):
      """
      :param pretrained_model_name_or_path: Path for converted BigDL-LLM optimized ggml
             binary checkpoint. The checkpoint should be converted by ``bigdl.llm.llm_convert``.
      :param model_family: The model family of the pretrained checkpoint.
             Currently we support ``"llama"``, ``"bloom"``, ``"gptneox"``, ``"starcoder"``
             and ``"chatglm"``.
      :param dtype: Which quantized precision will be converted.
              Now only `int4` and `int8` are supported, and `int8` only works for `llama`
              , `gptneox` and `starcoder`.
      :param cache_dir: (optional) This parameter will only be used when
             ``pretrained_model_name_or_path`` is a huggingface checkpoint or hub repo id.
             It indicates the saving path for the converted low precision model.
      :param tmp_path: (optional) Which path to store the intermediate fp16 model during the
             conversion process. Default to `None` so that intermediate model will not be saved.
      :param kwargs: keyword arguments which will be passed to the model instance
  
      :return: a model instance
      """
      logging.warning(
          "BigdlNativeForCausalLM has been deprecated, "
          "please switch to the new CausalLM API for sepcific models."
      )
      invalidInputError(
          model_family
          in ["llama", "gptneox", "bloom", "starcoder", "chatglm"],
          "Now we only support model family: 'llama', 'gptneox', 'bloom',"
          " 'starcoder', 'chatglm', '{}' is not in the list.".format(
              model_family
          ),
      )
      invalidInputError(
          dtype.lower() in ["int4", "int8"],
          "Now we only support int4 and int8 as date type for weight",
      )
  
      ggml_model_path = pretrained_model_name_or_path
  
      if model_family == "llama":
          from bigdl.llm.ggml.model.llama import Llama
  
          return Llama(model_path=ggml_model_path, **kwargs)
      elif model_family == "gptneox":
          from bigdl.llm.ggml.model.gptneox import Gptneox
  
          return Gptneox(model_path=ggml_model_path, **kwargs)
      elif model_family == "bloom":
          from bigdl.llm.ggml.model.bloom import Bloom
  
          return Bloom(model_path=ggml_model_path, **kwargs)
      elif model_family == "starcoder":
          from bigdl.llm.ggml.model.starcoder import Starcoder
  
          return Starcoder(model_path=ggml_model_path, **kwargs)
      elif model_family == "chatglm":
          from bigdl.llm.ggml.model.chatglm import ChatGLM
  
          return ChatGLM(model_path=ggml_model_path, **kwargs)
  
file_path: BigDL/python/llm/src/bigdl/llm/transformers/modelling_bigdl.py
imports: import importlib
  import logging
  from bigdl.llm.utils.common import invalidInputError
  from .model import *
label_desc: Use image node_id 1 for calling the BigdlNativeForCausalLM obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrained_model_name_or_path, model_family, dtype) and returns: Llama, Gptneox, Bloom, Starcoder, ChatGLM