class_docstr: Multi-turn conversational pipeline.
  
  This conversational pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"conversational"`.
  
  The models that this pipeline can use are models that have been fine-tuned on a multi-turn conversational task,
  currently: *'microsoft/DialoGPT-small'*, *'microsoft/DialoGPT-medium'*, *'microsoft/DialoGPT-large'*. See the
  up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=conversational).
  
  Usage:
  
  ```python
  conversational_pipeline = pipeline("conversational")
  
  conversation_1 = Conversation("Going to the movies tonight - any suggestions?")
  conversation_2 = Conversation("What's the last book you have read?")
  
  conversational_pipeline([conversation_1, conversation_2])
  
  conversation_1.add_user_input("Is it an action movie?")
  conversation_2.add_user_input("What is the genre of this book?")
  
  conversational_pipeline([conversation_1, conversation_2])
  ```
class_docstr_tok: ["Multi-turn","conversational","pipeline",".","This","conversational","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","conversational","''","`",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","multi-turn","conversational","task",",","currently",":","*","'microsoft\/DialoGPT-small","'","*",",","*","'microsoft\/DialoGPT-medium","'","*",",","*","'microsoft\/DialoGPT-large","'","*",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=conversational",")",".","Usage",":","``","`","python","conversational_pipeline","=","pipeline","(","``","conversational","''",")","conversation_1","=","Conversation","(","``","Going","to","the","movies","tonight","-","any","suggestions","?","''",")","conversation_2","=","Conversation","(","``","What","'s","the","last","book","you","have","read","?","''",")","conversational_pipeline","(","[","conversation_1",",","conversation_2","]",")","conversation_1.add_user_input","(","``","Is","it","an","action","movie","?","''",")","conversation_2.add_user_input","(","``","What","is","the","genre","of","this","book","?","''",")","conversational_pipeline","(","[","conversation_1",",","conversation_2","]",")","``","`"]
code: def _forward(
      self, model_inputs, minimum_tokens=10, **generate_kwargs
  ):
      max_length = generate_kwargs.get(
          "max_length", self.model.config.max_length
      )
  
      n = model_inputs["input_ids"].shape[1]
      if max_length - minimum_tokens < n:
          logger.warning(
              f"Conversation input is to long ({n}), trimming it to ({max_length} - {minimum_tokens})"
          )
          trim = max_length - minimum_tokens
          model_inputs["input_ids"] = model_inputs["input_ids"][
              :, -trim:
          ]
          if "attention_mask" in model_inputs:
              model_inputs["attention_mask"] = model_inputs[
                  "attention_mask"
              ][:, -trim:]
      conversation = model_inputs.pop("conversation")
      generate_kwargs["max_length"] = max_length
      output_ids = self.model.generate(
          **model_inputs, **generate_kwargs
      )
      if self.model.config.is_encoder_decoder:
          start_position = 1
      else:
          start_position = n
      return {
          "output_ids": output_ids[:, start_position:],
          "conversation": conversation,
      }
  
imports: import uuid
  from typing import Any, Dict, List, Optional, Union
  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 ConversationalPipeline obj's underlying member method code with example usage: obj._forward(model_inputs, minimum_tokens) and returns: dict