class_docstr: AutoMM is designed to simplify the fine-tuning of foundation models
  for downstream applications with just three lines of code.
  AutoMM seamlessly integrates with popular model zoos such as
  `HuggingFace Transformers <https://github.com/huggingface/transformers>`_,
  `TIMM <https://github.com/huggingface/pytorch-image-models>`_,
  and `MMDetection <https://github.com/open-mmlab/mmdetection>`_,
  accommodating a diverse range of data modalities,
  including image, text, tabular, and document data, whether used individually or in combination.
  It offers support for an array of tasks, encompassing classification, regression,
  object detection, named entity recognition, semantic matching, and image segmentation.
class_docstr_tok: ["AutoMM","is","designed","to","simplify","the","fine-tuning","of","foundation","models","for","downstream","applications","with","just","three","lines","of","code",".","AutoMM","seamlessly","integrates","with","popular","model","zoos","such","as","`","HuggingFace","Transformers","<","https",":","\/\/github.com\/huggingface\/transformers",">","`","_",",","`","TIMM","<","https",":","\/\/github.com\/huggingface\/pytorch-image-models",">","`","_",",","and","`","MMDetection","<","https",":","\/\/github.com\/open-mmlab\/mmdetection",">","`","_",",","accommodating","a","diverse","range","of","data","modalities",",","including","image",",","text",",","tabular",",","and","document","data",",","whether","used","individually","or","in","combination",".","It","offers","support","for","an","array","of","tasks",",","encompassing","classification",",","regression",",","object","detection",",","named","entity","recognition",",","semantic","matching",",","and","image","segmentation","."]
docstr: Load a predictor object from a directory specified by `path`. The to-be-loaded predictor
  can be completely or partially trained by .fit(). If a previous training has completed,
  it will load the checkpoint `model.ckpt`. Otherwise, if a previous training accidentally
  collapses in the middle, it can load the `last.ckpt` checkpoint by setting `resume=True`.
  It also supports loading one specific checkpoint given its path.
  
  Parameters
  ----------
  path
      The directory to load the predictor object.
  resume
      Whether to resume training from `last.ckpt`. This is useful when a training was accidentally
      broken during the middle, and we want to resume the training from the last saved checkpoint.
  verbosity
      Verbosity levels range from 0 to 4 and control how much information is printed.
      Higher levels correspond to more detailed print statements.
      You can set verbosity = 0 to suppress warnings.
  
  Returns
  -------
  The loaded predictor object.
docstr_tok: ["Load","a","predictor","object","from","a","directory","specified","by","`","path","`",".","The","to-be-loaded","predictor","can","be","completely","or","partially","trained","by",".fit","(",")",".","If","a","previous","training","has","completed",",","it","will","load","the","checkpoint","`","model.ckpt","`",".","Otherwise",",","if","a","previous","training","accidentally","collapses","in","the","middle",",","it","can","load","the","`","last.ckpt","`","checkpoint","by","setting","`","resume=True","`",".","It","also","supports","loading","one","specific","checkpoint","given","its","path",".","Parameters","--","--","--","--","--","path","The","directory","to","load","the","predictor","object",".","resume","Whether","to","resume","training","from","`","last.ckpt","`",".","This","is","useful","when","a","training","was","accidentally","broken","during","the","middle",",","and","we","want","to","resume","the","training","from","the","last","saved","checkpoint",".","verbosity","Verbosity","levels","range","from","0","to","4","and","control","how","much","information","is","printed",".","Higher","levels","correspond","to","more","detailed","print","statements",".","You","can","set","verbosity","=","0","to","suppress","warnings",".","Returns","--","--","--","-","The","loaded","predictor","object","."]
code: def load(
      cls,
      path: str,
      resume: Optional[bool] = False,
      verbosity: Optional[int] = 3,
  ):
      """
      Load a predictor object from a directory specified by `path`. The to-be-loaded predictor
      can be completely or partially trained by .fit(). If a previous training has completed,
      it will load the checkpoint `model.ckpt`. Otherwise, if a previous training accidentally
      collapses in the middle, it can load the `last.ckpt` checkpoint by setting `resume=True`.
      It also supports loading one specific checkpoint given its path.
  
      Parameters
      ----------
      path
          The directory to load the predictor object.
      resume
          Whether to resume training from `last.ckpt`. This is useful when a training was accidentally
          broken during the middle, and we want to resume the training from the last saved checkpoint.
      verbosity
          Verbosity levels range from 0 to 4 and control how much information is printed.
          Higher levels correspond to more detailed print statements.
          You can set verbosity = 0 to suppress warnings.
  
      Returns
      -------
      The loaded predictor object.
      """
      dir_path, ckpt_path = get_dir_ckpt_paths(path=path)
  
      assert os.path.isdir(
          dir_path
      ), f"'{dir_path}' must be an existing directory."
      predictor = cls(label="dummy_label")
  
      with open(os.path.join(dir_path, "assets.json"), "r") as fp:
          assets = json.load(fp)
      if (
          "class_name" in assets
          and assets["class_name"] == "MultiModalMatcher"
      ):
          learner_class = MultiModalMatcher
      elif assets["problem_type"] in [
          OBJECT_DETECTION,
          OPEN_VOCABULARY_OBJECT_DETECTION,
      ]:
          learner_class = ObjectDetectionLearner
      elif assets["problem_type"] == NER:
          learner_class = NERLearner
      elif assets["problem_type"] == FEW_SHOT_CLASSIFICATION:
          learner_class = FewShotSVMLearner
      elif assets["problem_type"] == SEMANTIC_SEGMENTATION:
          learner_class = SemanticSegmentationLearner
      else:
          learner_class = BaseLearner
  
      predictor._learner = learner_class.load(
          path=path, resume=resume, verbosity=verbosity
      )
      return predictor
  
imports: from __future__ import annotations
  import json
  import logging
  import os
  import warnings
  from typing import Dict, List, Optional, Union
  import pandas
  import transformers
  from autogluon.common.utils.log_utils import set_logger_verbosity, verbosity2loglevel
  from autogluon.core.metrics import Scorer
  from .constants import AUTOMM_TUTORIAL_MODE, FEW_SHOT_CLASSIFICATION, NER, OBJECT_DETECTION, OPEN_VOCABULARY_OBJECT_DETECTION, SEMANTIC_SEGMENTATION
  from .learners import BaseLearner, FewShotSVMLearner, MultiModalMatcher, NERLearner, ObjectDetectionLearner, SemanticSegmentationLearner
  from .problem_types import PROBLEM_TYPES_REG
  from .utils import get_dir_ckpt_paths
label_desc: Use image node_id 28 for calling the MultiModalPredictor obj's underlying member method code with example usage: obj.load(cls, path, resume, verbosity) and returns: predictor