class_docstr: Task for text generation.
  
  Attributes:
      model:
          1. Model name
          2. Model name on Backprop's text-generation endpoint
          3. Model object that implements the text-generation 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: Performs a training step and returns loss.
  
  Args:
      batch: Batch output from the dataloader
      batch_idx: Batch index.
docstr_tok: ["Performs","a","training","step","and","returns","loss",".","Args",":","batch",":","Batch","output","from","the","dataloader","batch_idx",":","Batch","index","."]
code: def step(self, batch, batch_idx):
      """
      Performs a training step and returns loss.
  
      Args:
          batch: Batch output from the dataloader
          batch_idx: Batch index.
      """
      return self.model.training_step(batch)
  
file_path: backprop/backprop/tasks/text_generation.py
imports: from typing import List, Tuple, Union, Dict
  from backprop.models import AutoModel, BaseModel
  from .base import Task
  from backprop.utils.datasets import TextToTextDataset
  import requests
  from transformers.optimization import Adafactor
label_desc: Use image node_id 4 for calling the TextGeneration obj's underlying member method code with example usage: obj.step(batch, batch_idx) and returns: self