docstr: Initializes the class in charge of loading processed datasets and of running evaluation.
  
  This class should be task-dependent, backend independent.
  
  Args:
      config (`PretrainedConfig`):
          The config of the model.
      preprocessor: (`Preprocessor`):
          The preprocessor associated to the model. This will be used to prepare the datasets.
      preprocessor_kwargs (`Optional[Dict[str, Any]]`, defaults to `None`):
          Keyword arguments that will be passed to the preprocessor during dataset processing.
          This allows customizing the behavior of the preprocessor.
docstr_tok: ["Initializes","the","class","in","charge","of","loading","processed","datasets","and","of","running","evaluation",".","This","class","should","be","task-dependent",",","backend","independent",".","Args",":","config","(","`","PretrainedConfig","`",")",":","The","config","of","the","model",".","preprocessor",":","(","`","Preprocessor","`",")",":","The","preprocessor","associated","to","the","model",".","This","will","be","used","to","prepare","the","datasets",".","preprocessor_kwargs","(","`","Optional","[","Dict","[","str",",","Any","]","]","`",",","defaults","to","`","None","`",")",":","Keyword","arguments","that","will","be","passed","to","the","preprocessor","during","dataset","processing",".","This","allows","customizing","the","behavior","of","the","preprocessor","."]
code: def __init__(
      self,
      config: "PretrainedConfig",
      preprocessor: Preprocessor,
      preprocessor_kwargs: Optional[Dict[str, Any]] = None,
  ):
      """
      Initializes the class in charge of loading processed datasets and of running evaluation.
  
      This class should be task-dependent, backend independent.
  
      Args:
          config (`PretrainedConfig`):
              The config of the model.
          preprocessor: (`Preprocessor`):
              The preprocessor associated to the model. This will be used to prepare the datasets.
          preprocessor_kwargs (`Optional[Dict[str, Any]]`, defaults to `None`):
              Keyword arguments that will be passed to the preprocessor during dataset processing.
              This allows customizing the behavior of the preprocessor.
      """
      if not isinstance(
          preprocessor, self.ACCEPTED_PREPROCESSOR_CLASSES
      ):
          raise ValueError(
              f"Preprocessor is incorrect, provided an instance of {type(preprocessor)} but expected one of the "
              f"following type: {', '.join(cls_.__name__ for cls_ in self.ACCEPTED_PREPROCESSOR_CLASSES)}."
          )
  
      self.config = config
      self.preprocessor = preprocessor
      (
          self.defaults,
          self.preprocessor_kwargs,
      ) = self.create_defaults_and_kwargs_from_preprocessor_kwargs(
          preprocessor_kwargs
      )
  
imports: import copy
  import functools
  import itertools
  from abc import ABC, abstractmethod
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  from datasets import Dataset, DatasetDict
  from datasets import load_dataset
  from transformers import PreTrainedTokenizerBase
  from transformers.image_processing_utils import BaseImageProcessor
  from ..None import logging
label_desc: Use image node_id 1 to create a new TaskProcessor object from inherited base classes: ABC with example: obj = TaskProcessor(config, preprocessor, preprocessor_kwargs)