class_docstr: Loader that loads the captions of an image
class_docstr_tok: ["Loader","that","loads","the","captions","of","an","image"]
code: def __init__(
      self,
      path_images: Union[str, List[str]] = None,
      blip_processor: str = None,
      blip_model: str = None,
      caption_gpu=True,
      load_in_8bit=True,
      # True doesn't seem to work, even though https://huggingface.co/Salesforce/blip2-flan-t5-xxl#in-8-bit-precision-int8
      load_half=False,
      load_gptq="",
      load_awq="",
      load_exllama=False,
      use_safetensors=False,
      revision=None,
      min_new_tokens=20,
      max_tokens=50,
      gpu_id="auto",
  ):
      if blip_model is None or blip_model is None:
          blip_processor = "Salesforce/blip-image-captioning-base"
          blip_model = "Salesforce/blip-image-captioning-base"
  
      super().__init__(path_images, blip_processor, blip_model)
      self.blip_processor = blip_processor
      self.blip_model = blip_model
      self.processor = None
      self.model = None
      self.caption_gpu = caption_gpu
      self.context_class = NullContext
      self.load_in_8bit = (
          load_in_8bit and have_bitsandbytes
      )  # only for blip2
      self.load_half = load_half
      self.load_gptq = load_gptq
      self.load_awq = load_awq
      self.load_exllama = load_exllama
      self.use_safetensors = use_safetensors
      self.revision = revision
      self.gpu_id = gpu_id
      # default prompt
      self.prompt = "image of"
      self.min_new_tokens = min_new_tokens
      self.max_tokens = max_tokens
  
      self.device = "cpu"
      self.device_map = {"": "cpu"}
      self.set_context()
  
file_path: h2ogpt/src/image_captions.py
imports: from typing import List, Union, Any, Tuple
  import requests
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  from utils import get_device, NullContext, clear_torch_cache
  from importlib.metadata import distribution, PackageNotFoundError
label_desc: Use image node_id 1 to create a new H2OImageCaptionLoader object from inherited base classes: ImageCaptionLoader with example: obj = H2OImageCaptionLoader(path_images, blip_processor, blip_model, caption_gpu, load_in_8bit, load_half, load_gptq, load_awq, load_exllama, use_safetensors, revision, min_new_tokens, max_tokens, gpu_id)