code: def test_llm_used_tokens(tmpdir):
      input_features = [
          text_feature(name="input", encoder={"type": "passthrough"})
      ]
      output_features = [text_feature(name="output")]
  
      df = pd.read_json(
          "https://raw.githubusercontent.com/sahil280114/codealpaca/master/data/code_alpaca_20k.json"
      ).head(10)
  
      # df = generate_data(input_features, output_features, filename=csv_filename, num_examples=25)
  
      config = {
          MODEL_TYPE: MODEL_LLM,
          BASE_MODEL: "hf-internal-testing/tiny-random-BartModel",
          INPUT_FEATURES: input_features,
          OUTPUT_FEATURES: output_features,
          TRAINER: {
              TYPE: "finetune",
              BATCH_SIZE: 1,
              EPOCHS: 3,
              "enable_gradient_checkpointing": True,
          },
      }
  
      config[ADAPTER] = {TYPE: "lora"}
  
      model = LudwigModel(config)
      assert model.config_obj.trainer.enable_gradient_checkpointing
  
      model.train(
          dataset=df,
          output_directory=str(tmpdir),
          skip_save_processed_input=False,
      )
  
      with open(
          os.path.join(
              str(tmpdir),
              "api_experiment_run",
              "model",
              "training_progress.json",
          ),
          encoding="utf-8",
      ) as f:
          progress_tracker = json.load(f)
  
      assert (
          progress_tracker["cumulative_step_token_usage"]["11"]
          == progress_tracker["total_tokens_used"]
          == 612
      )
      assert progress_tracker["checkpoint_to_epoch"] == {
          "1": 1,
          "2": 1,
          "3": 2,
          "4": 2,
          "5": 3,
          "6": 3,
      }
      assert progress_tracker["checkpoint_to_step"] == {
          "1": 4,
          "2": 4,
          "3": 8,
          "4": 8,
          "5": 12,
          "6": 12,
      }
      assert progress_tracker["cumulative_checkpoint_token_usage"] == {
          "1": 204,
          "2": 204,
          "3": 408,
          "4": 408,
          "5": 612,
          "6": 612,
      }
      assert progress_tracker["incremental_checkpoint_token_usage"] == {
          "1": 204,
          "2": 0,
          "3": 204,
          "4": 0,
          "5": 204,
          "6": 0,
      }
  
imports: from __future__ import annotations
  import copy
  import json
  import os
  import pathlib
  from typing import Any
  import numpy
  import pandas
  import pytest
  import torch
  import ludwig.error
  from ludwig.api import LudwigModel
  from ludwig.constants import ADAPTER, BACKEND, BASE_MODEL, BATCH_SIZE, COMBINER, EPOCHS, GENERATION, INPUT_FEATURES, MERGE_ADAPTER_INTO_BASE_MODEL, MODEL_ECD, MODEL_LLM, MODEL_TYPE, OUTPUT_FEATURES, POSTPROCESSOR, PREPROCESSING, PRETRAINED_ADAPTER_WEIGHTS, PROGRESSBAR, PROMPT, QUANTIZATION, TARGET_MODULES, TRAINER, TYPE
  from ludwig.models.llm import LLM
  from ludwig.schema.model_types.base import ModelConfig
  from ludwig.utils.fs_utils import list_file_names_in_directory
  from ludwig.utils.types import DataFrame
  from tests.integration_tests.utils import category_feature, generate_data, text_feature
label_desc: Use image node_id 29 for calling a global function with example usage: test_llm_used_tokens(tmpdir) without return types