code: def test_packing(
      step_lr,
      optimizer,
      get_model,
      tokenizer,
      train,
      mocker,
      setup_tokenizer,
  ):
      from llama_recipes.finetuning import main
  
      setup_tokenizer(tokenizer)
  
      kwargs = {
          "model_name": "meta-llama/Llama-2-7b-hf",
          "batch_size_training": 8,
          "val_batch_size": 1,
          "use_peft": False,
          "dataset": "samsum_dataset",
          "batching_strategy": "packing",
      }
  
      main(**kwargs)
  
      assert train.call_count == 1
  
      args, kwargs = train.call_args
      train_dataloader = args[1]
      eval_dataloader = args[2]
  
      assert len(train_dataloader) == 96
      assert len(eval_dataloader) == 42
  
      batch = next(iter(train_dataloader))
  
      assert "labels" in batch.keys()
      assert "input_ids" in batch.keys()
      assert "attention_mask" in batch.keys()
  
      assert batch["labels"][0].size(0) == 4096
      assert batch["input_ids"][0].size(0) == 4096
      assert batch["attention_mask"][0].size(0) == 4096
  
imports: import pytest
  from unittest.mock import patch
label_desc: Use image node_id 1 for calling a global function with example usage: test_packing(step_lr, optimizer, get_model, tokenizer, train, mocker, setup_tokenizer) without return types