def _set_loss_cls(self, label: Optional[Union[int, float]], number_of_sentences: int) -> None:
        """
        Helper method to choose a loss class for the model based on the type
        of model, whether it has label or not and the number of sentences per example.

        Args:
            label: The label type, None should be passed if there is no label.
            number_of_sentences: number of sentences (two or three normally).
        """
        if label:
            if number_of_sentences == 2:
                if isinstance(label, int):
                    from sentence_transformers.losses import ContrastiveLoss

                    self._loss_cls = ContrastiveLoss
                else:
                    from sentence_transformers.losses import CosineSimilarityLoss

                    self._loss_cls = CosineSimilarityLoss

            else:
                if isinstance(label, int):
                    from sentence_transformers.losses import BatchHardTripletLoss

                    self._loss_cls = BatchHardTripletLoss
                else:
                    from sentence_transformers.losses import BatchAllTripletLoss

                    self._loss_cls = BatchAllTripletLoss
                    from sentence_transformers.datasets import SentenceLabelDataset

                    self.data_kwargs["dataset_type"] = SentenceLabelDataset

        else:
            if number_of_sentences == 3:
                from sentence_transformers.losses import TripletLoss

                self._loss_cls = TripletLoss
            else:
                from sentence_transformers.losses import MultipleNegativesRankingLoss

                self._loss_cls = MultipleNegativesRankingLoss

        Helper method to choose a loss class for the model based on the type
        of model, whether it has label or not and the number of sentences per example.

        Args:
            label: The label type, None should be passed if there is no label.
            number_of_sentences: number of sentences (two or three normally).
        
argilla-v1/src/argilla_v1/client/feedback/training/frameworks/sentence_transformers.py