class_docstr: Pipeline for text to text generation using seq2seq models.
  
  Example:
  
  ```python
  >>> from transformers import pipeline
  
  >>> generator = pipeline(model="mrm8488/t5-base-finetuned-question-generation-ap")
  >>> generator(
  ...     "answer: Manuel context: Manuel has created RuPERTa-base with the support of HF-Transformers and Google"
  ... )
  [{'generated_text': 'question: Who created the RuPERTa-base?'}]
  ```
  
  Learn more about the basics of using a pipeline in the [pipeline tutorial](../pipeline_tutorial). You can pass text
  generation parameters to this pipeline to control stopping criteria, decoding strategy, and more. Learn more about
  text generation parameters in [Text generation strategies](../generation_strategies) and [Text
  generation](text_generation).
  
  This Text2TextGenerationPipeline pipeline can currently be loaded from [`pipeline`] using the following task
  identifier: `"text2text-generation"`.
  
  The models that this pipeline can use are models that have been fine-tuned on a translation task. See the
  up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=text2text-generation). For a list of available
  parameters, see the [following
  documentation](https://huggingface.co/docs/transformers/en/main_classes/text_generation#transformers.generation.GenerationMixin.generate)
  
  Usage:
  
  ```python
  text2text_generator = pipeline("text2text-generation")
  text2text_generator("question: What is 42 ? context: 42 is the answer to life, the universe and everything")
  ```
class_docstr_tok: ["Pipeline","for","text","to","text","generation","using","seq2seq","models",".","Example",":","``","`","python",">",">",">","from","transformers","import","pipeline",">",">",">","generator","=","pipeline","(","model=","''","mrm8488\/t5-base-finetuned-question-generation-ap","''",")",">",">",">","generator","(","...","``","answer",":","Manuel","context",":","Manuel","has","created","RuPERTa-base","with","the","support","of","HF-Transformers","and","Google","''","...",")","[","{","'generated_text","'",":","'question",":","Who","created","the","RuPERTa-base","?","'","}","]","``","`","Learn","more","about","the","basics","of","using","a","pipeline","in","the","[","pipeline","tutorial","]","(","..","\/pipeline_tutorial",")",".","You","can","pass","text","generation","parameters","to","this","pipeline","to","control","stopping","criteria",",","decoding","strategy",",","and","more",".","Learn","more","about","text","generation","parameters","in","[","Text","generation","strategies","]","(","..","\/generation_strategies",")","and","[","Text","generation","]","(","text_generation",")",".","This","Text2TextGenerationPipeline","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","text2text-generation","''","`",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","translation","task",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=text2text-generation",")",".","For","a","list","of","available","parameters",",","see","the","[","following","documentation","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/en\/main_classes\/text_generation","#","transformers.generation.GenerationMixin.generate",")","Usage",":","``","`","python","text2text_generator","=","pipeline","(","``","text2text-generation","''",")","text2text_generator","(","``","question",":","What","is","42","?","context",":","42","is","the","answer","to","life",",","the","universe","and","everything","''",")","``","`"]
docstr: Generate the output text(s) using text(s) given as inputs.
  
  Args:
      args (`str` or `List[str]`):
          Input text for the encoder.
      return_tensors (`bool`, *optional*, defaults to `False`):
          Whether or not to include the tensors of predictions (as token indices) in the outputs.
      return_text (`bool`, *optional*, defaults to `True`):
          Whether or not to include the decoded texts in the outputs.
      clean_up_tokenization_spaces (`bool`, *optional*, defaults to `False`):
          Whether or not to clean up the potential extra spaces in the text output.
      truncation (`TruncationStrategy`, *optional*, defaults to `TruncationStrategy.DO_NOT_TRUNCATE`):
          The truncation strategy for the tokenization within the pipeline. `TruncationStrategy.DO_NOT_TRUNCATE`
          (default) will never truncate, but it is sometimes desirable to truncate the input to fit the model's
          max_length instead of throwing an error down the line.
      generate_kwargs:
          Additional keyword arguments to pass along to the generate method of the model (see the generate method
          corresponding to your framework [here](./model#generative-models)).
  
  Return:
      A list or a list of list of `dict`: Each result comes as a dictionary with the following keys:
  
      - **generated_text** (`str`, present when `return_text=True`) -- The generated text.
      - **generated_token_ids** (`torch.Tensor` or `tf.Tensor`, present when `return_tensors=True`) -- The token
        ids of the generated text.
docstr_tok: ["Generate","the","output","text","(","s",")","using","text","(","s",")","given","as","inputs",".","Args",":","args","(","`","str","`","or","`","List","[","str","]","`",")",":","Input","text","for","the","encoder",".","return_tensors","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","include","the","tensors","of","predictions","(","as","token","indices",")","in","the","outputs",".","return_text","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","include","the","decoded","texts","in","the","outputs",".","clean_up_tokenization_spaces","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","clean","up","the","potential","extra","spaces","in","the","text","output",".","truncation","(","`","TruncationStrategy","`",",","*","optional","*",",","defaults","to","`","TruncationStrategy.DO_NOT_TRUNCATE","`",")",":","The","truncation","strategy","for","the","tokenization","within","the","pipeline",".","`","TruncationStrategy.DO_NOT_TRUNCATE","`","(","default",")","will","never","truncate",",","but","it","is","sometimes","desirable","to","truncate","the","input","to","fit","the","model's","max_length","instead","of","throwing","an","error","down","the","line",".","generate_kwargs",":","Additional","keyword","arguments","to","pass","along","to","the","generate","method","of","the","model","(","see","the","generate","method","corresponding","to","your","framework","[","here","]","(",".\/model","#","generative-models",")",")",".","Return",":","A","list","or","a","list","of","list","of","`","dict","`",":","Each","result","comes","as","a","dictionary","with","the","following","keys",":","-","*","*","generated_text","*","*","(","`","str","`",",","present","when","`","return_text=True","`",")","--","The","generated","text",".","-","*","*","generated_token_ids","*","*","(","`","torch.Tensor","`","or","`","tf.Tensor","`",",","present","when","`","return_tensors=True","`",")","--","The","token","ids","of","the","generated","text","."]
code: def __call__(self, *args, **kwargs):
      r"""
      Generate the output text(s) using text(s) given as inputs.
  
      Args:
          args (`str` or `List[str]`):
              Input text for the encoder.
          return_tensors (`bool`, *optional*, defaults to `False`):
              Whether or not to include the tensors of predictions (as token indices) in the outputs.
          return_text (`bool`, *optional*, defaults to `True`):
              Whether or not to include the decoded texts in the outputs.
          clean_up_tokenization_spaces (`bool`, *optional*, defaults to `False`):
              Whether or not to clean up the potential extra spaces in the text output.
          truncation (`TruncationStrategy`, *optional*, defaults to `TruncationStrategy.DO_NOT_TRUNCATE`):
              The truncation strategy for the tokenization within the pipeline. `TruncationStrategy.DO_NOT_TRUNCATE`
              (default) will never truncate, but it is sometimes desirable to truncate the input to fit the model's
              max_length instead of throwing an error down the line.
          generate_kwargs:
              Additional keyword arguments to pass along to the generate method of the model (see the generate method
              corresponding to your framework [here](./model#generative-models)).
  
      Return:
          A list or a list of list of `dict`: Each result comes as a dictionary with the following keys:
  
          - **generated_text** (`str`, present when `return_text=True`) -- The generated text.
          - **generated_token_ids** (`torch.Tensor` or `tf.Tensor`, present when `return_tensors=True`) -- The token
            ids of the generated text.
      """
  
      result = super().__call__(*args, **kwargs)
      if (
          isinstance(args[0], list)
          and all(isinstance(el, str) for el in args[0])
          and all(len(res) == 1 for res in result)
      ):
          return [res[0] for res in result]
      return result
  
imports: import enum
  import warnings
  from ..tokenization_utils import TruncationStrategy
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging
  from .base import PIPELINE_INIT_ARGS, Pipeline
label_desc: Use image node_id 5 for calling the Text2TextGenerationPipeline obj's underlying member method code with example usage: obj.__call__() and returns: result, unknown