docstr: Initializes the training arguments.
docstr_tok: ["Initializes","the","training","arguments","."]
code: def init_training_args(self) -> None:
      """
      Initializes the training arguments.
      """
      self.model_kwargs = {}
  
      # Use a sample of the dataset to do some checking
      sample = self._train_dataset[0]
  
      if self._cross_encoder:
          # Cross encoders don't support training with triplets
          if (n := len(sample.texts)) > 2:
              raise ValueError(
                  f"Cross-encoders don't support training with triplets, the dataset has `{n}` sentences per sample."
              )
  
          from sentence_transformers import CrossEncoder
  
          self._trainer_cls = CrossEncoder
      else:
          from sentence_transformers import SentenceTransformer
  
          self._trainer_cls = SentenceTransformer
  
      self.model_kwargs = get_default_args(self._trainer_cls.__init__)
      self.trainer_kwargs = get_default_args(self._trainer_cls.fit)
      # These arguments don't exactly fit in either of the previous kwargs.
      # We store here arguments that can be passed to the DataLoader or
      # related to the dataset types defined in sentence-transformers.
      self.data_kwargs = {}
      self.data_kwargs["batch_size"] = 32
      self.data_kwargs["dataset_type"] = None
  
      # For a guide on the selection of the loss function:
      # https://huggingface.co/blog/how-to-train-sentence-transformers#loss-functions-for-training-a-sentence-transformers-model
      self._set_loss_cls(sample.label, len(sample.texts))
      self._logger.warning(
          f"`loss_cls` parameter set as default `{self._loss_cls}`."
      )
  
      if self._eval_dataset:
          self._set_evaluator(
              label=sample.label, number_of_sentences=len(sample.texts)
          )
          self._logger.warning(
              f"`evaluator` parameter set to `{self.trainer_kwargs['evaluator']}` by default."
          )
  
file_path: argilla/src/argilla/client/feedback/training/frameworks/sentence_transformers.py
imports: import logging
  from typing import TYPE_CHECKING, List, Optional, Tuple, Union
  from argilla.client.feedback.training.base import ArgillaTrainerSkeleton
  from argilla.client.feedback.training.schemas.base import TrainingTaskForSentenceSimilarity
  from argilla.training.utils import filter_allowed_args, get_default_args
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 2 for calling the ArgillaSentenceTransformersTrainer obj's underlying member method code with example usage: obj.init_training_args() without return types