code: def test_integration_torch_conversation_encoder_decoder(self):
      # When
      tokenizer = AutoTokenizer.from_pretrained(
          "facebook/blenderbot_small-90M"
      )
      model = AutoModelForSeq2SeqLM.from_pretrained(
          "facebook/blenderbot_small-90M"
      )
      conversation_agent = ConversationalPipeline(
          model=model, tokenizer=tokenizer, device=DEFAULT_DEVICE_NUM
      )
  
      conversation_1 = Conversation(
          "My name is Sarah and I live in London"
      )
      conversation_2 = Conversation(
          "Going to the movies tonight, What movie would you recommend? "
      )
      # Then
      self.assertEqual(len(conversation_1.past_user_inputs), 0)
      self.assertEqual(len(conversation_2.past_user_inputs), 0)
      # When
      result = conversation_agent(
          [conversation_1, conversation_2],
          do_sample=False,
          max_length=1000,
      )
      # Then
      self.assertEqual(result, [conversation_1, conversation_2])
      self.assertEqual(len(result[0].past_user_inputs), 1)
      self.assertEqual(len(result[1].past_user_inputs), 1)
      self.assertEqual(len(result[0].generated_responses), 1)
      self.assertEqual(len(result[1].generated_responses), 1)
      self.assertEqual(
          result[0].past_user_inputs[0],
          "My name is Sarah and I live in London",
      )
      self.assertEqual(
          result[0].generated_responses[0],
          "hi sarah, i live in london as well. do you have any plans for the weekend?",
      )
      self.assertEqual(
          result[1].past_user_inputs[0],
          "Going to the movies tonight, What movie would you recommend? ",
      )
      self.assertEqual(
          result[1].generated_responses[0],
          "i don't know... i'm not really sure. what movie are you going to see?",
      )
      # When
      conversation_1.add_user_input("Not yet, what about you?")
      conversation_2.add_user_input("What's your name?")
      result = conversation_agent(
          [conversation_1, conversation_2],
          do_sample=False,
          max_length=1000,
      )
      # Then
      self.assertEqual(result, [conversation_1, conversation_2])
      self.assertEqual(len(result[0].past_user_inputs), 2)
      self.assertEqual(len(result[1].past_user_inputs), 2)
      self.assertEqual(len(result[0].generated_responses), 2)
      self.assertEqual(len(result[1].generated_responses), 2)
      self.assertEqual(
          result[0].past_user_inputs[1], "Not yet, what about you?"
      )
      self.assertEqual(
          result[0].generated_responses[1],
          "i don't have any plans yet. i'm not sure what to do yet.",
      )
      self.assertEqual(
          result[1].past_user_inputs[1], "What's your name?"
      )
      self.assertEqual(
          result[1].generated_responses[1],
          "i don't have a name, but i'm going to see a horror movie.",
      )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/tests/pipelines/test_pipelines_conversational.py
imports: import unittest
  from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoTokenizer, BlenderbotSmallForConditionalGeneration, BlenderbotSmallTokenizer, Conversation, ConversationalPipeline, TFAutoModelForCausalLM, pipeline
  from transformers.testing_utils import require_tf, require_torch, slow, torch_device
  from .test_pipelines_common import ANY, PipelineTestCaseMeta
label_desc: Use image node_id 10 for calling the ConversationalPipelineTests obj's underlying member method code with example usage: obj.test_integration_torch_conversation_encoder_decoder() without return types