class_docstr: Task for Question Answering.
  
  Attributes:
      model:
          1. Model name
          2. Model name on Backprop's qa endpoint
          3. Model object that implements the qa task
      local (optional): Run locally. Defaults to False
      api_key (optional): Backprop API key for non-local inference
      device (optional): Device to run inference on. Defaults to "cuda" if available.
docstr: Perform QA, either on docstore or on provided context.
  
  Args:
      question: Question (string or list of strings) for qa model.
      context: Context (string or list of strings) to ask question from.
      prev_qa (optional): List of previous question, answer tuples or list of prev_qa.
  
  Returns:
      Answer string or list of answer strings
docstr_tok: ["Perform","QA",",","either","on","docstore","or","on","provided","context",".","Args",":","question",":","Question","(","string","or","list","of","strings",")","for","qa","model",".","context",":","Context","(","string","or","list","of","strings",")","to","ask","question","from",".","prev_qa","(","optional",")",":","List","of","previous","question",",","answer","tuples","or","list","of","prev_qa",".","Returns",":","Answer","string","or","list","of","answer","strings"]
code: def __call__(
      self,
      question: Union[str, List[str]],
      context: Union[str, List[str]],
      prev_qa: Union[
          List[Tuple[str, str]], List[List[Tuple[str, str]]]
      ] = [],
  ):
      """Perform QA, either on docstore or on provided context.
  
      Args:
          question: Question (string or list of strings) for qa model.
          context: Context (string or list of strings) to ask question from.
          prev_qa (optional): List of previous question, answer tuples or list of prev_qa.
  
      Returns:
          Answer string or list of answer strings
      """
  
      prev_q = []
      prev_a = []
      if prev_qa != [] and type(prev_qa[0]) == list:
          for pqa in prev_qa:
              if len(pqa) == 0:
                  prev_q.append([])
                  prev_a.append([])
              else:
                  q = []
                  a = []
                  for x in pqa:
                      q.append(x[0])
                      a.append(x[1])
                  prev_q.append(q)
                  prev_a.append(a)
      else:
          prev_q = [q for q, a in prev_qa]
          prev_a = [a for q, a in prev_qa]
  
      task_input = {
          "question": question,
          "context": context,
          "prev_q": prev_q,
          "prev_a": prev_a,
      }
      if self.local:
          return self.model(task_input, task="qa")
      else:
          task_input["model"] = self.model
  
          res = requests.post(
              "https://api.backprop.co/qa",
              json=task_input,
              headers={"x-api-key": self.api_key},
          ).json()
  
          if res.get("message"):
              raise Exception(
                  f"Failed to make API request: {res['message']}"
              )
  
          return res["answer"]
  
file_path: backprop/backprop/tasks/qa.py
imports: from typing import List, Tuple, Union, Dict
  from .base import Task
  from backprop.models import BaseModel, AutoModel
  from transformers.optimization import Adafactor
  from backprop.utils.datasets import TextToTextDataset
  import requests
label_desc: Use image node_id 3 for calling the QA obj's underlying member method code with example usage: obj.__call__(question, context, prev_qa) and returns: self, res