class_docstr: High-level Python wrapper for a bloom.cpp model.
docstr: Load a bloom.cpp model from `model_path`.
  
  Args:
      model_path: Path to the model.
      n_ctx: Maximum context size.
      n_parts: Number of parts to split the model into. If -1, the number of parts
      is automatically determined.
      seed: Random seed. For default value -1, current timestamp is used as seed.
      f16_kv: Use half-precision for key/value cache.
      logits_all: Return logits for all tokens, not just the last token.
      vocab_only: Only load the vocabulary no weights.
      use_mmap: Use mmap if possible.
      use_mlock: Force the system to keep the model in RAM.
      embedding: Embedding mode only.
      n_threads: Number of threads to use. Default to be -1, means auto.
      n_batch: Maximum number of prompt tokens to batch together when calling bloom_eval.
      last_n_tokens_size: Maximum number of tokens to keep in the last_n_tokens deque.
      lora_base: Optional path to base model, useful if using a quantized base model and
      you want to apply LoRA to an f16 model.
      lora_path: Path to a LoRA file to apply to the model.
      verbose: Print verbose output to stderr.
  
  Raises:
      ValueError: If the model path does not exist.
  
  Returns:
      A Bloom instance.
docstr_tok: ["Load","a","bloom.cpp","model","from","`","model_path","`",".","Args",":","model_path",":","Path","to","the","model",".","n_ctx",":","Maximum","context","size",".","n_parts",":","Number","of","parts","to","split","the","model","into",".","If","-1",",","the","number","of","parts","is","automatically","determined",".","seed",":","Random","seed",".","For","default","value","-1",",","current","timestamp","is","used","as","seed",".","f16_kv",":","Use","half-precision","for","key\/value","cache",".","logits_all",":","Return","logits","for","all","tokens",",","not","just","the","last","token",".","vocab_only",":","Only","load","the","vocabulary","no","weights",".","use_mmap",":","Use","mmap","if","possible",".","use_mlock",":","Force","the","system","to","keep","the","model","in","RAM",".","embedding",":","Embedding","mode","only",".","n_threads",":","Number","of","threads","to","use",".","Default","to","be","-1",",","means","auto",".","n_batch",":","Maximum","number","of","prompt","tokens","to","batch","together","when","calling","bloom_eval",".","last_n_tokens_size",":","Maximum","number","of","tokens","to","keep","in","the","last_n_tokens","deque",".","lora_base",":","Optional","path","to","base","model",",","useful","if","using","a","quantized","base","model","and","you","want","to","apply","LoRA","to","an","f16","model",".","lora_path",":","Path","to","a","LoRA","file","to","apply","to","the","model",".","verbose",":","Print","verbose","output","to","stderr",".","Raises",":","ValueError",":","If","the","model","path","does","not","exist",".","Returns",":","A","Bloom","instance","."]
code: def __init__(
      self,
      model_path: str,
      n_ctx: int = 512,
      n_parts: int = -1,
      n_gpu_layers: int = 0,
      seed: int = -1,
      f16_kv: bool = True,
      logits_all: bool = False,
      vocab_only: bool = False,
      use_mmap: bool = False,
      use_mlock: bool = False,
      embedding: bool = False,
      n_threads: Optional[int] = -1,
      n_batch: int = 512,
      last_n_tokens_size: int = 64,
      lora_base: Optional[str] = None,
      lora_path: Optional[str] = None,
      verbose: bool = True,
  ):
      """Load a bloom.cpp model from `model_path`.
  
      Args:
          model_path: Path to the model.
          n_ctx: Maximum context size.
          n_parts: Number of parts to split the model into. If -1, the number of parts
          is automatically determined.
          seed: Random seed. For default value -1, current timestamp is used as seed.
          f16_kv: Use half-precision for key/value cache.
          logits_all: Return logits for all tokens, not just the last token.
          vocab_only: Only load the vocabulary no weights.
          use_mmap: Use mmap if possible.
          use_mlock: Force the system to keep the model in RAM.
          embedding: Embedding mode only.
          n_threads: Number of threads to use. Default to be -1, means auto.
          n_batch: Maximum number of prompt tokens to batch together when calling bloom_eval.
          last_n_tokens_size: Maximum number of tokens to keep in the last_n_tokens deque.
          lora_base: Optional path to base model, useful if using a quantized base model and
          you want to apply LoRA to an f16 model.
          lora_path: Path to a LoRA file to apply to the model.
          verbose: Print verbose output to stderr.
  
      Raises:
          ValueError: If the model path does not exist.
  
      Returns:
          A Bloom instance.
      """
      self.model_path = model_path
      self.ctx = bloom_load(
          bytes(model_path, encoding="utf-8"), n_ctx, n_threads
      )
      invalidInputError(
          self.ctx is not None,
          f"Failed to load model from {model_path}",
      )
      self.n_ctx = n_ctx
      self.n_parts = n_parts
      self.n_gpu_layers = n_gpu_layers
      self.f16_kv = f16_kv
      self.seed = seed
      self.logits_all = logits_all
      self.vocab_only = vocab_only
      self.use_mmap = use_mmap
      self.use_mlock = use_mlock
      self.embedding = embedding
      self.n_threads = n_threads
      self.n_batch = n_batch
      self.last_n_tokens_size = last_n_tokens_size
      self.lora_base = lora_base
      self.lora_path = lora_path
      self.verbose = verbose
      # TODO: Some parameters are temporarily not supported
      unsupported_arg = {
          "n_parts": -1,
          "n_gpu_layers": 0,
          "f16_kv": True,
          "logits_all": False,
          "vocab_only": False,
          "use_mmap": False,
          "use_mlock": False,
          "last_n_tokens_size": 64,
          "lora_base": None,
          "lora_path": None,
          "verbose": True,
      }
      for arg in unsupported_arg.keys():
          if getattr(self, arg) != unsupported_arg[arg]:
              warnings.warn(
                  f"The parameter {arg} is temporarily unsupported, "
                  "please use the default value."
              )
  
imports: from .bloom_cpp import bloom_load, bloom_free, bloom_run
  from .bloom_cpp import bloom_tokenize, bloom_detokenize, bloom_forward, bloom_eval, bloom_embed
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.ggml.model.generation import GenerationMixin
  from typing import List, Optional, Generator, Sequence, Union
  import time
  import uuid
  import warnings
label_desc: Use image node_id 1 to create a new Bloom object from inherited base classes: GenerationMixin with example: obj = Bloom(model_path, n_ctx, n_parts, n_gpu_layers, seed, f16_kv, logits_all, vocab_only, use_mmap, use_mlock, embedding, n_threads, n_batch, last_n_tokens_size, lora_base, lora_path, verbose)