class_docstr: Loader that extracts text from images
code: def load(self, prompt=None) -> List[Document]:
      if self._ocr_model is None:
          self.load_model()
      context_class = (
          torch.cuda.device(self.gpu_id)
          if "cuda" in str(self.device)
          else NullContext
      )
      results = []
      with context_class:
          for document_path in self.document_paths:
              caption, metadata = self._get_captions_and_metadata(
                  model=self._ocr_model, document_path=document_path
              )
              doc = Document(
                  page_content=" \n".join(caption), metadata=metadata
              )
              results.append(doc)
  
      return results
  
imports: from typing import List, Union, Any, Tuple, Optional
  import requests
  import torch
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  import numpy
  from utils import get_device, clear_torch_cache, NullContext
  from doctr.utils.common_types import AbstractFile
label_desc: Use image node_id 6 for calling the H2OOCRLoader obj's underlying member method code with example usage: obj.load(prompt) and returns: results