code: def __init__(
      self,
      dataset: "FeedbackDataset",
      task: Union[
          TrainingTaskForSFT,
          TrainingTaskForRM,
          TrainingTaskForPPO,
          TrainingTaskForDPO,
      ],
      prepared_data=None,
      model: Optional[Union[str, "PreTrainedModel"]] = None,
      tokenizer: Optional["PreTrainedTokenizer"] = None,
      seed: int = None,
  ) -> None:
      super().__init__(
          dataset=dataset,
          task=task,
          prepared_data=prepared_data,
          model=model,
          seed=seed,
      )
      import torch
      from datasets import DatasetDict
      from transformers import set_seed
  
      self.trainer_model = model if not isinstance(model, str) else None
      self.trainer_tokenizer = tokenizer
      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 = "gpt2-medium"
  
      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 not isinstance(
          self._task,
          (
              TrainingTaskForSFT,
              TrainingTaskForRM,
              TrainingTaskForPPO,
              TrainingTaskForDPO,
          ),
      ):
          raise NotImplementedError(
              f"Task {self._task} not supported in TRL."
          )
  
      from trl import DPOTrainer, PPOTrainer, RewardTrainer, SFTTrainer
  
      self.trainer_mapping = {
          TrainingTaskForSFT: SFTTrainer,
          TrainingTaskForRM: RewardTrainer,
          TrainingTaskForPPO: PPOTrainer,
          TrainingTaskForDPO: DPOTrainer,
      }
      self.trainer_cls = self.trainer_mapping[type(self._task)]
  
      self.init_training_args()
  
file_path: argilla/src/argilla/client/feedback/training/frameworks/trl.py
imports: import logging
  from typing import TYPE_CHECKING, Dict, List, Optional, Union
  from argilla.client.feedback.training.base import ArgillaTrainerSkeleton
  from argilla.client.feedback.training.schemas.base import TrainingTaskForDPO, TrainingTaskForPPO, TrainingTaskForRM, TrainingTaskForSFT
  from argilla.training.utils import filter_allowed_args
  from argilla.utils.dependency import require_dependencies, requires_dependencies
label_desc: Use image node_id 1 to create a new ArgillaTRLTrainer object from inherited base classes: ArgillaTrainerSkeleton with example: obj = ArgillaTRLTrainer(dataset, task, prepared_data, model, tokenizer, seed)