code: def test_lightseq_bart(checkpoint_path):
      dirname, modelname = split_checkpoint_path(checkpoint_path)
  
      args = {
          "arch": "ls_bart_base",
      }
      fs_bart = (
          BARTModel.from_pretrained(
              dirname, checkpoint_file=modelname, fp16=False
          )
          .to("cuda:0")
          .eval()
      )
      ls_bart = (
          LSBARTModel.from_pretrained(
              dirname, checkpoint_file=modelname, fp16=False, **args
          )
          .to("cuda:0")
          .eval()
      )
  
      tokens = fs_bart.encode(SAMPLE_TEXT).unsqueeze(0).to("cuda:0")
  
      fs_output = fs_bart.extract_features(tokens)
      ls_output = ls_bart.extract_features(tokens)
  
      assert torch.allclose(
          fs_output.flatten(),
          ls_output.flatten(),
          rtol=1e-1,
          atol=1e-1,
          equal_nan=False,
      )
  
file_path: lightseq/examples/training/fairseq/ls_finetune_bart/convert_lightseq_to_huggingface.py
imports: import argparse
  from pathlib import Path
  import fairseq
  import torch
  from packaging import version
  from torch import nn
  from transformers import BartConfig, BartForConditionalGeneration, BartForSequenceClassification, BartModel, BartTokenizer
  from lightseq.training.cli.fs_modules import LSBARTModel
  from fairseq.models.bart import BARTModel
label_desc: Use image node_id 5 for calling a global function with example usage: test_lightseq_bart(checkpoint_path) without return types