code: def test_finetuning_peft(
      step_lr,
      optimizer,
      get_peft_model,
      gen_peft_config,
      get_dataset,
      tokenizer,
      get_model,
      train,
  ):
      kwargs = {"use_peft": True}
  
      get_dataset.return_value = get_fake_dataset()
  
      main(**kwargs)
  
      assert get_peft_model.return_value.to.call_args.args[0] == "cuda"
      assert (
          get_peft_model.return_value.print_trainable_parameters.call_count
          == 1
      )
  
file_path: llama-recipes/tests/test_finetuning.py
imports: import pytest
  from pytest import approx
  from unittest.mock import patch
  from torch.nn import Linear
  from torch.optim import AdamW
  from torch.utils.data.dataloader import DataLoader
  from torch.utils.data.sampler import BatchSampler
  from llama_recipes.finetuning import main
  from llama_recipes.data.sampler import LengthBasedBatchSampler
label_desc: Use image node_id 4 for calling a global function with example usage: test_finetuning_peft(step_lr, optimizer, get_peft_model, gen_peft_config, get_dataset, tokenizer, get_model, train) without return types