class_docstr: Language generation pipeline using any `ModelWithLMHead`. This pipeline predicts the words that will follow a
  specified text prompt.
  
  This language generation pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"text-generation"`.
  
  The models that this pipeline can use are models that have been trained with an autoregressive language modeling
  objective, which includes the uni-directional models in the library (e.g. gpt2). See the list of available models
  on [huggingface.co/models](https://huggingface.co/models?filter=text-generation).
docstr: Complete the prompt(s) given as inputs.
  
  Args:
      args (`str` or `List[str]`):
          One or several prompts (or one list of prompts) to complete.
      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.
      return_full_text (`bool`, *optional*, defaults to `True`):
          If set to `False` only added text is returned, otherwise the full text is returned Only meaningful if
          *return_text* is set to True.
      clean_up_tokenization_spaces (`bool`, *optional*, defaults to `False`):
          Whether or not to clean up the potential extra spaces in the text output.
      prefix (`str`, *optional*):
          Prefix added to prompt.
      handle_long_generation (`str`, *optional*):
          By default, this pipelines does not handle long generation (ones that exceed in one form or the other
          the model maximum length). There is no perfect way to adress this (more info
          :https://github.com/huggingface/transformers/issues/14033#issuecomment-948385227). This provides common
          strategies to work around that problem depending on your use case.
  
          - `None` : default strategy where nothing in particular happens
          - `"hole"`: Truncates left of input, and leaves a gap wide enough to let generation happen (might
            truncate a lot of the prompt and not suitable when generation exceed the model capacity)
  
      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: ["Complete","the","prompt","(","s",")","given","as","inputs",".","Args",":","args","(","`","str","`","or","`","List","[","str","]","`",")",":","One","or","several","prompts","(","or","one","list","of","prompts",")","to","complete",".","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",".","return_full_text","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","If","set","to","`","False","`","only","added","text","is","returned",",","otherwise","the","full","text","is","returned","Only","meaningful","if","*","return_text","*","is","set","to","True",".","clean_up_tokenization_spaces","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","clean","up","the","potential","extra","spaces","in","the","text","output",".","prefix","(","`","str","`",",","*","optional","*",")",":","Prefix","added","to","prompt",".","handle_long_generation","(","`","str","`",",","*","optional","*",")",":","By","default",",","this","pipelines","does","not","handle","long","generation","(","ones","that","exceed","in","one","form","or","the","other","the","model","maximum","length",")",".","There","is","no","perfect","way","to","adress","this","(","more","info",":","https",":","\/\/github.com\/huggingface\/transformers\/issues\/14033","#","issuecomment-948385227",")",".","This","provides","common","strategies","to","work","around","that","problem","depending","on","your","use","case",".","-","`","None","`",":","default","strategy","where","nothing","in","particular","happens","-","`","``","hole","''","`",":","Truncates","left","of","input",",","and","leaves","a","gap","wide","enough","to","let","generation","happen","(","might","truncate","a","lot","of","the","prompt","and","not","suitable","when","generation","exceed","the","model","capacity",")","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, text_inputs, **kwargs):
      """
      Complete the prompt(s) given as inputs.
  
      Args:
          args (`str` or `List[str]`):
              One or several prompts (or one list of prompts) to complete.
          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.
          return_full_text (`bool`, *optional*, defaults to `True`):
              If set to `False` only added text is returned, otherwise the full text is returned Only meaningful if
              *return_text* is set to True.
          clean_up_tokenization_spaces (`bool`, *optional*, defaults to `False`):
              Whether or not to clean up the potential extra spaces in the text output.
          prefix (`str`, *optional*):
              Prefix added to prompt.
          handle_long_generation (`str`, *optional*):
              By default, this pipelines does not handle long generation (ones that exceed in one form or the other
              the model maximum length). There is no perfect way to adress this (more info
              :https://github.com/huggingface/transformers/issues/14033#issuecomment-948385227). This provides common
              strategies to work around that problem depending on your use case.
  
              - `None` : default strategy where nothing in particular happens
              - `"hole"`: Truncates left of input, and leaves a gap wide enough to let generation happen (might
                truncate a lot of the prompt and not suitable when generation exceed the model capacity)
  
          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.
      """
      return super().__call__(text_inputs, **kwargs)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/text_generation.py
imports: import enum
  import warnings
  from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING
  from ..utils import add_end_docstrings, is_tf_available
  from .base import PIPELINE_INIT_ARGS, Pipeline
label_desc: Use image node_id 4 for calling the TextGenerationPipeline obj's underlying member method code with example usage: obj.__call__(text_inputs) and returns: super