code: def test_prepare_for_training_sft(
      feedback_dataset_guidelines: str,
      feedback_dataset_fields: List["AllowedFieldTypes"],
      feedback_dataset_questions: List["AllowedQuestionTypes"],
      feedback_dataset_records: List[FeedbackRecord],
  ) -> None:
      dataset = FeedbackDataset(
          guidelines=feedback_dataset_guidelines,
          fields=feedback_dataset_fields,
          questions=feedback_dataset_questions,
      )
      dataset.add_records(records=feedback_dataset_records * 2)
  
      try_wrong_format(
          dataset=dataset,
          task=TrainingTask.for_supervised_fine_tuning,
          format_func=SFTReturnTypes,
      )
  
      task = TrainingTask.for_supervised_fine_tuning(
          formatting_func_sft
      )
      train_dataset = dataset.prepare_for_training(
          framework=FRAMEWORK, task=task
      )
      assert isinstance(train_dataset, Dataset)
      assert len(train_dataset) == 4
      train_dataset_dict = dataset.prepare_for_training(
          framework=FRAMEWORK, task=task, train_size=0.5
      )
      assert isinstance(train_dataset_dict, DatasetDict)
      assert tuple(train_dataset_dict.keys()) == ("train", "test")
      assert len(train_dataset_dict["train"]) == 2
  
      small_model_id = "sshleifer/tiny-gpt2"
      loaded_model = AutoModelForCausalLM.from_pretrained(
          small_model_id
      )
      loaded_tokenizer = AutoTokenizer.from_pretrained(small_model_id)
      loaded_tokenizer.pad_token_id = loaded_tokenizer.eos_token_id
      # Set some values to track and assert later
      loaded_model.test_value = 12
      loaded_tokenizer.test_value = 12
      for model, tokenizer in [
          (small_model_id, None),
          (loaded_model, loaded_tokenizer),
      ]:
          trainer = ArgillaTrainer(
              dataset,
              task,
              framework=FRAMEWORK,
              model=model,
              tokenizer=tokenizer,
          )
          trainer.update_config(max_steps=3)
          assert trainer._trainer.training_args_kwargs["max_steps"] == 3
          trainer.update_config(max_steps=1)
          assert trainer._trainer.training_args_kwargs["max_steps"] == 1
          train_with_cleanup(trainer, OUTPUT_DIR)
  
          eval_trainer = ArgillaTrainer(
              dataset,
              task,
              framework=FRAMEWORK,
              model=model,
              train_size=0.5,
          )
          eval_trainer.update_config(max_steps=1)
          train_with_cleanup(eval_trainer, OUTPUT_DIR)
  
          # Verify that the passed model and tokenizer are used
          if tokenizer is not None:
              assert trainer._trainer.trainer_model.test_value == 12
              assert trainer._trainer.trainer_tokenizer.test_value == 12
  
imports: import os
  import re
  from collections import Counter
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List
  import pytest
  from argilla.client.feedback.dataset import FeedbackDataset
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.training.base import ArgillaTrainer
  from argilla.client.feedback.training.schemas.base import TrainingTask
  from argilla.client.feedback.training.schemas.return_types import DPOReturnTypes, PPOReturnTypes, RMReturnTypes, SFTReturnTypes
  from datasets import Dataset, DatasetDict
  from peft import LoraConfig, TaskType
  from transformers import AutoModelForCausalLM, AutoModelForSequenceClassification, AutoTokenizer
  from trl import AutoModelForCausalLMWithValueHead
  from tests.integration.client.feedback.helpers import formatting_func_dpo, formatting_func_ppo, formatting_func_rm, formatting_func_sft
  from tests.integration.training.helpers import train_with_cleanup
label_desc: Use image node_id 3 for calling a global function with example usage: test_prepare_for_training_sft(feedback_dataset_guidelines, feedback_dataset_fields, feedback_dataset_questions, feedback_dataset_records) without return types