code: def __init__(self, *args, **kwargs):
      require_dependencies(
          ["torch", "datasets", "transformers", "evaluate", "seqeval"]
      )
      super().__init__(*args, **kwargs)
  
      import torch
      from transformers import (
          AutoModelForSequenceClassification,
          AutoModelForTokenClassification,
          set_seed,
      )
  
      self.trainer_model = None
      self.trainer_tokenizer = None
      self.trainer_pipeline = None
  
      self.device = "cpu"
      if torch.backends.mps.is_available():
          self.device = "mps"
      elif torch.cuda.is_available():
          self.device = "cuda"
  
      if self._seed is None:
          self._seed = 42
      set_seed(self._seed)
  
      if self._model is None:
          self._model = "bert-base-cased"
          self._logger.warning(
              f"No model defined. Using the default model {self._model}."
          )
  
      if isinstance(self._dataset, DatasetDict):
          self._train_dataset = self._dataset["train"]
          self._eval_dataset = self._dataset["test"]
      else:
          self._train_dataset = self._dataset
          self._eval_dataset = None
  
      if self._record_class == TextClassificationRecord:
          if self._multi_label:
              self._id2label = dict(
                  enumerate(
                      self._train_dataset.features["label"][0].names
                  )
              )
              self._label_list = self._train_dataset.features["label"][
                  0
              ].names
          else:
              self._id2label = dict(
                  enumerate(self._train_dataset.features["label"].names)
              )
              self._label_list = self._train_dataset.features[
                  "label"
              ].names
          self._label2id = {v: k for k, v in self._id2label.items()}
  
          self._model_class = AutoModelForSequenceClassification
  
      elif self._record_class == TokenClassificationRecord:
          self._label_list = self._train_dataset.features[
              "ner_tags"
          ].feature.names
          self._id2label = dict(enumerate(self._label_list))
          self._label2id = {v: k for k, v in self._id2label.items()}
  
          self._model_class = AutoModelForTokenClassification
      else:
          raise NotImplementedError("Text2TextRecord is not supported.")
  
      self.init_training_args()
  
file_path: argilla/src/argilla/training/transformers.py
imports: import logging
  from typing import List, Union
  from datasets import DatasetDict
  from argilla.client.models import TextClassificationRecord, TokenClassificationRecord
  from argilla.training.base import ArgillaTrainerSkeleton
  from argilla.training.utils import _apply_column_mapping, filter_allowed_args, get_default_args
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 1 to create a new ArgillaTransformersTrainer object from inherited base classes: ArgillaTrainerSkeleton with example: obj = ArgillaTransformersTrainer()