class_docstr: Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image.
  
  This image to text pipeline can currently be loaded from pipeline() using the following task identifier:
  "image-to-text".
  
  See the list of available models on
  [huggingface.co/models](https://huggingface.co/models?pipeline_tag=image-to-text).
class_docstr_tok: ["Image","To","Text","pipeline","using","a","`","AutoModelForVision2Seq","`",".","This","pipeline","predicts","a","caption","for","a","given","image",".","This","image","to","text","pipeline","can","currently","be","loaded","from","pipeline","(",")","using","the","following","task","identifier",":","''","image-to-text","''",".","See","the","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","pipeline_tag=image-to-text",")","."]
code: def _forward(self, model_inputs, generate_kwargs=None):
      if generate_kwargs is None:
          generate_kwargs = {}
      # FIXME: We need to pop here due to a difference in how `generation_utils.py` and `generation_tf_utils.py`
      #  parse inputs. In the Tensorflow version, `generate` raises an error if we don't use `input_ids` whereas
      #  the PyTorch version matches it with `self.model.main_input_name` or `self.model.encoder.main_input_name`
      #  in the `_prepare_model_inputs` method.
      inputs = model_inputs.pop(self.model.main_input_name)
      model_outputs = self.model.generate(
          inputs, **model_inputs, **generate_kwargs
      )
      return model_outputs
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/image_to_text.py
imports: from typing import List, Union
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, is_vision_available, logging, requires_backends
  from .base import PIPELINE_INIT_ARGS, Pipeline
label_desc: Use image node_id 5 for calling the ImageToTextPipeline obj's underlying member method code with example usage: obj._forward(model_inputs, generate_kwargs) and returns: model_outputs