class_docstr: Task for classification.
  
  Attributes:
      model:
          1. Model name
          2. Model name on Backprop's text-classification endpoint
          3. Model object that implements the text-classification 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.
class_docstr_tok: ["Task","for","classification",".","Attributes",":","model",":","1",".","Model","name","2",".","Model","name","on","Backprop","'s","text-classification","endpoint","3",".","Model","object","that","implements","the","text-classification","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","."]
code: def __init__(
      self,
      model: Union[str, BaseModel] = None,
      local: bool = False,
      api_key: str = None,
      device: str = None,
  ):
      models = AutoModel.list_models(task=TASK)
  
      super().__init__(
          model,
          local=local,
          api_key=api_key,
          device=device,
          models=models,
          task=TASK,
          default_local_model=DEFAULT_LOCAL_MODEL,
          local_aliases=LOCAL_ALIASES,
      )
  
file_path: backprop/backprop/tasks/text_classification.py
imports: from typing import List, Tuple, Union, Optional
  from backprop.models import BaseModel, AutoModel
  from .base import Task
  import torch
  from transformers.optimization import AdamW
  from backprop.utils.datasets import SingleLabelTextClassificationDataset
  import requests
label_desc: Use image node_id 1 to create a new TextClassification object from inherited base classes: Task with example: obj = TextClassification(model, local, api_key, device)