code: def test_sft_with_peft(
      feedback_dataset_guidelines: str,
      feedback_dataset_fields: List["AllowedFieldTypes"],
      feedback_dataset_questions: List["AllowedQuestionTypes"],
      feedback_dataset_records: List[FeedbackRecord],
      tmp_path,
  ) -> None:
      dataset = FeedbackDataset(
          guidelines=feedback_dataset_guidelines,
          fields=feedback_dataset_fields,
          questions=feedback_dataset_questions,
      )
      dataset.add_records(records=feedback_dataset_records * 2)
  
      task = TrainingTask.for_supervised_fine_tuning(
          formatting_func_sft
      )
  
      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
      trainer = ArgillaTrainer(
          dataset,
          task,
          framework=FRAMEWORK,
          model=loaded_model,
          tokenizer=loaded_tokenizer,
      )
      peft_config = LoraConfig(
          task_type=TaskType.CAUSAL_LM,
          inference_mode=False,
          r=8,
          lora_alpha=16,
          lora_dropout=0.05,  # 32,
      )
      trainer.update_config(peft_config=peft_config)
      trainer.train(tmp_path)
      assert "adapter_config.json" in os.listdir(tmp_path)
      assert "adapter_model.bin" in os.listdir(tmp_path)
  
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 10 for calling a global function with example usage: test_sft_with_peft(feedback_dataset_guidelines, feedback_dataset_fields, feedback_dataset_questions, feedback_dataset_records, tmp_path) without return types