class_docstr: Loader that extracts text from images
code: def set_context(self):
      if get_device() == "cuda":
          import torch
  
          n_gpus = (
              torch.cuda.device_count()
              if torch.cuda.is_available()
              else 0
          )
          if n_gpus > 0:
              self.context_class = torch.device
              self.device = "cuda"
          else:
              self.device = "cpu"
      else:
          self.device = "cpu"
  
file_path: h2ogpt/src/image_pix2struct.py
imports: from typing import List, Union, Any, Tuple
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  from utils import get_device, clear_torch_cache
  from PIL import Image
label_desc: Use image node_id 2 for calling the H2OPix2StructLoader obj's underlying member method code with example usage: obj.set_context() without return types