class_docstr: Translates from one language to another.
  
  This translation pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"translation_xx_to_yy"`.
  
  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=translation).
  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
  en_fr_translator = pipeline("translation_en_to_fr")
  en_fr_translator("How old are you?")
  ```
class_docstr_tok: ["Translates","from","one","language","to","another",".","This","translation","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","translation_xx_to_yy","''","`",".","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=translation",")",".","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","en_fr_translator","=","pipeline","(","``","translation_en_to_fr","''",")","en_fr_translator","(","``","How","old","are","you","?","''",")","``","`"]
docstr: Translate the text(s) given as inputs.
  
  Args:
      args (`str` or `List[str]`):
          Texts to be translated.
      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.
      src_lang (`str`, *optional*):
          The language of the input. Might be required for multilingual models. Will not have any effect for
          single pair translation models
      tgt_lang (`str`, *optional*):
          The language of the desired output. Might be required for multilingual models. Will not have any effect
          for single pair translation models
      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:
  
      - **translation_text** (`str`, present when `return_text=True`) -- The translation.
      - **translation_token_ids** (`torch.Tensor` or `tf.Tensor`, present when `return_tensors=True`) -- The
        token ids of the translation.
docstr_tok: ["Translate","the","text","(","s",")","given","as","inputs",".","Args",":","args","(","`","str","`","or","`","List","[","str","]","`",")",":","Texts","to","be","translated",".","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",".","src_lang","(","`","str","`",",","*","optional","*",")",":","The","language","of","the","input",".","Might","be","required","for","multilingual","models",".","Will","not","have","any","effect","for","single","pair","translation","models","tgt_lang","(","`","str","`",",","*","optional","*",")",":","The","language","of","the","desired","output",".","Might","be","required","for","multilingual","models",".","Will","not","have","any","effect","for","single","pair","translation","models","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",":","-","*","*","translation_text","*","*","(","`","str","`",",","present","when","`","return_text=True","`",")","--","The","translation",".","-","*","*","translation_token_ids","*","*","(","`","torch.Tensor","`","or","`","tf.Tensor","`",",","present","when","`","return_tensors=True","`",")","--","The","token","ids","of","the","translation","."]
code: def __call__(self, *args, **kwargs):
      r"""
      Translate the text(s) given as inputs.
  
      Args:
          args (`str` or `List[str]`):
              Texts to be translated.
          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.
          src_lang (`str`, *optional*):
              The language of the input. Might be required for multilingual models. Will not have any effect for
              single pair translation models
          tgt_lang (`str`, *optional*):
              The language of the desired output. Might be required for multilingual models. Will not have any effect
              for single pair translation models
          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:
  
          - **translation_text** (`str`, present when `return_text=True`) -- The translation.
          - **translation_token_ids** (`torch.Tensor` or `tf.Tensor`, present when `return_tensors=True`) -- The
            token ids of the translation.
      """
      return super().__call__(*args, **kwargs)
  
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 4 for calling the TranslationPipeline obj's underlying member method code with example usage: obj.__call__() and returns: super