class_docstr: API for calling LLM.generate
docstr: Configurate model
docstr_tok: ["Configurate","model"]
code: def __init__(
      self, model_type: str, model_path: str, ckpt_path: str = None
  ) -> None:
      """
      Configurate model
      """
      if (
          model_type + model_path + (ckpt_path or "")
          in ColossalAPI.__instances
      ):
          return
      else:
          ColossalAPI.__instances[
              model_type + model_path + (ckpt_path or "")
          ] = self
      self.model_type = model_type
      self.model = AutoModelForCausalLM.from_pretrained(
          model_path, torch_dtype=torch.float16, trust_remote_code=True
      )
  
      if ckpt_path is not None:
          state_dict = torch.load(ckpt_path)
          self.model.load_state_dict(state_dict)
      self.model.to(torch.cuda.current_device())
  
      # Configurate tokenizer
      self.tokenizer = AutoTokenizer.from_pretrained(
          model_path, trust_remote_code=True
      )
  
      self.model.eval()
  
imports: from typing import Any, List, Mapping, Optional
  import torch
  from colossalqa.local.utils import get_response, post_http_request
  from colossalqa.mylogging import get_logger
  from langchain.callbacks.manager import CallbackManagerForLLMRun
  from langchain.llms.base import LLM
  from transformers import AutoModelForCausalLM, AutoTokenizer
label_desc: Use image node_id 1 to create a new ColossalAPI object  with example: obj = ColossalAPI(model_type, model_path, ckpt_path)