class_docstr: A ready-to-use Response Generator  model
  
  The class can be used to generate and continue dialogue given the user input.
  The given YAML must contain the fields specified in the *_NEEDED[] lists.
  It needs to be used with custom.py to load the expanded  model with added tokens like bos,eos, and speaker's tokens.
docstr: Complete a dialogue given the user's input.
  Arguments
  ---------
  turn: str
      User input which is the last turn of the dialogue.
  
  Returns
  -------
  response
      Generated response for the user input based on the dialogue history.
docstr_tok: ["Complete","a","dialogue","given","the","user","'s","input",".","Arguments","--","--","--","--","-","turn",":","str","User","input","which","is","the","last","turn","of","the","dialogue",".","Returns","--","--","--","-","response","Generated","response","for","the","user","input","based","on","the","dialogue","history","."]
code: def generate_response(self, turn):
      """
      Complete a dialogue given the user's input.
      Arguments
      ---------
      turn: str
          User input which is the last turn of the dialogue.
  
      Returns
      -------
      response
          Generated response for the user input based on the dialogue history.
      """
  
      self.history.append(turn)
      inputs = self.prepare_input()
      hyps = self.generate(inputs)
      predicted_words = self.model.tokenizer.batch_decode(
          hyps[:, inputs[0].shape[1] :],
          skip_special_tokens=True,
          clean_up_tokenization_spaces=True,
      )
      response = predicted_words[0]
      self.history.append(response)
      return response
  
imports: import torch
  from itertools import chain
  from speechbrain.inference.interfaces import Pretrained, EncodeDecodePipelineMixin
label_desc: Use image node_id 2 for calling the ResponseGenerator obj's underlying member method code with example usage: obj.generate_response(turn) and returns: response