class_docstr: Initialises a T5 model that has been finetuned on qa, summarisation and emotion detection.
  
  Attributes:
      model_path: path to an appropriate T5 model on huggingface (kiri-ai/t5-base-qa-summary-emotion)
      name: string identifier for the model. Lowercase letters and numbers.
          No spaces/special characters except dashes.
      description: String description of the model.
      tasks: List of supported task strings
      details: Dictionary of additional details about the model
      device: Device for model. Defaults to "cuda" if available.
class_docstr_tok: ["Initialises","a","T5","model","that","has","been","finetuned","on","qa",",","summarisation","and","emotion","detection",".","Attributes",":","model_path",":","path","to","an","appropriate","T5","model","on","huggingface","(","kiri-ai\/t5-base-qa-summary-emotion",")","name",":","string","identifier","for","the","model",".","Lowercase","letters","and","numbers",".","No","spaces\/special","characters","except","dashes",".","description",":","String","description","of","the","model",".","tasks",":","List","of","supported","task","strings","details",":","Dictionary","of","additional","details","about","the","model","device",":","Device","for","model",".","Defaults","to","``","cuda","''","if","available","."]
docstr: Uses the model for the chosen task
  
  Args:
      task_input: input dictionary according to the chosen task's specification
      task: one of text-generation, emotion, summarisation, qa 
docstr_tok: ["Uses","the","model","for","the","chosen","task","Args",":","task_input",":","input","dictionary","according","to","the","chosen","task","'s","specification","task",":","one","of","text-generation",",","emotion",",","summarisation",",","qa"]
code: def __call__(self, task_input, task="text-generation"):
      """
      Uses the model for the chosen task
  
      Args:
          task_input: input dictionary according to the chosen task's specification
          task: one of text-generation, emotion, summarisation, qa
      """
      if task in ["text-generation", "generation"]:
          text = task_input.pop("text")
          return self.generate(text, **task_input)
      elif task == "emotion":
          return self.emote_or_summary(task_input["text"], "emotion")
      elif task == "summarisation":
          return self.emote_or_summary(task_input["text"], "summarise")
      elif task == "qa":
          prev_q = task_input.get("prev_q", [])
          prev_a = task_input.get("prev_a", [])
          prev_qa = []
  
          if len(prev_q) != 0:
              if type(prev_q[0]) != list:
                  qas = []
                  for x in range(len(prev_q)):
                      qas.append((prev_q[x], prev_a[x]))
                  prev_qa.append(qas)
              else:
                  for pqa in zip(prev_q, prev_a):
                      if len(pqa[0]) == 0:
                          prev_qa.append([])
                      else:
                          qas = []
                          for x in range(len(pqa[0])):
                              pair = (pqa[0][x], pqa[1][x])
                              qas.append(pair)
                          prev_qa.append(qas)
  
          return self.qa(
              task_input["question"],
              task_input["context"],
              prev_qa=prev_qa,
          )
      else:
          raise ValueError(f"Unsupported task: {task}")
  
file_path: backprop/backprop/models/t5_qa_summary_emotion/model.py
imports: from typing import List, Tuple, Dict
  import torch
  from backprop.models import HFSeq2SeqTGModel
label_desc: Use image node_id 2 for calling the T5QASummaryEmotion obj's underlying member method code with example usage: obj.__call__(task_input, task) and returns: self, self, self, self