class_docstr: Constructs a Donut processor which wraps a Donut feature extractor and an XLMRoBERTa tokenizer into a single
  processor.
  
  [`DonutProcessor`] offers all the functionalities of [`DonutFeatureExtractor`] and
  [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. See the [`~DonutProcessor.__call__`] and
  [`~DonutProcessor.decode`] for more information.
  
  Args:
      feature_extractor ([`DonutFeatureExtractor`]):
          An instance of [`DonutFeatureExtractor`]. The feature extractor is a required input.
      tokenizer ([`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]):
          An instance of [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. The tokenizer is a required input.
docstr: Temporarily sets the tokenizer for processing the input. Useful for encoding the labels when fine-tuning TrOCR.
code: def as_target_processor(self):
      """
      Temporarily sets the tokenizer for processing the input. Useful for encoding the labels when fine-tuning TrOCR.
      """
      warnings.warn(
          "`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your "
          "labels by using the argument `text` of the regular `__call__` method (either in the same call as "
          "your images inputs, or in a separate call."
      )
      self._in_target_context_manager = True
      self.current_processor = self.tokenizer
      yield
      self.current_processor = self.feature_extractor
      self._in_target_context_manager = False
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/donut/processing_donut.py
imports: import re
  import warnings
  from contextlib import contextmanager
  from ...processing_utils import ProcessorMixin
label_desc: Use image node_id 5 for calling the DonutProcessor obj's underlying member method code with example usage: obj.as_target_processor() without return types