code: def test_prepare_for_training_sentence_transformers_with_defaults(
      use_label: bool,
      cross_encoder: bool,
  ) -> None:
      dataset = FeedbackDataset.from_huggingface(
          "plaguss/snli-small", split="train[:8]"
      )
  
      if use_label:
          task = TrainingTask.for_sentence_similarity(
              texts=[
                  dataset.field_by_name("premise"),
                  dataset.field_by_name("hypothesis"),
              ],
              label=dataset.question_by_name("label"),
          )
      else:
          task = TrainingTask.for_sentence_similarity(
              texts=[
                  dataset.field_by_name("premise"),
                  dataset.field_by_name("hypothesis"),
              ]
          )
  
      trainer = ArgillaTrainer(
          dataset=dataset,
          task=task,
          framework=__FRAMEWORK__,
          framework_kwargs={"cross_encoder": cross_encoder},
      )
      trainer.update_config(batch_size=2)
      assert trainer._trainer.data_kwargs["batch_size"] == 2
      trainer.update_config(epochs=1)
      assert trainer._trainer.trainer_kwargs["epochs"] == 1
      train_with_cleanup(trainer, __OUTPUT_DIR__)
  
      eval_trainer = ArgillaTrainer(
          dataset=dataset,
          task=task,
          framework=__FRAMEWORK__,
          train_size=0.5,
          framework_kwargs={"cross_encoder": cross_encoder},
      )
      eval_trainer.update_config(epochs=1)
      train_with_cleanup(eval_trainer, __OUTPUT_DIR__)
  
      assert (
          len(
              eval_trainer.predict(
                  [
                      ["first sentence", "second sentence"],
                      ["to compare", "another one"],
                  ]
              )
          )
          == 2
      )
      assert (
          len(
              eval_trainer.predict(
                  ["first sentence", ["to compare", "another one"]]
              )
          )
          == 2
      )
  
file_path: argilla/tests/integration/client/feedback/training/test_sentence_transformers.py
imports: from typing import TYPE_CHECKING, Callable, List, Union
  import pytest
  from argilla.client.feedback.dataset import FeedbackDataset
  from argilla.client.feedback.schemas.fields import TextField
  from argilla.client.feedback.schemas.questions import LabelQuestion
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.training.base import ArgillaTrainer
  from argilla.client.feedback.training.schemas.base import LabelQuestion, RatingQuestionUnification, TrainingTask
  from sentence_transformers import CrossEncoder, InputExample, SentenceTransformer
  from tests.integration.client.feedback.helpers import formatting_func_sentence_transformers, formatting_func_sentence_transformers_all_lists, formatting_func_sentence_transformers_case_1_b, formatting_func_sentence_transformers_case_2, formatting_func_sentence_transformers_case_3_a, formatting_func_sentence_transformers_case_3_b, formatting_func_sentence_transformers_case_4, formatting_func_sentence_transformers_rating_question
  from tests.integration.training.helpers import train_with_cleanup
label_desc: Use image node_id 5 for calling a global function with example usage: test_prepare_for_training_sentence_transformers_with_defaults(use_label, cross_encoder) without return types