code: def _convert_transformer_inputs(model, wps: WordpieceBatch, is_train):
      # Adapter for the HFWrapper. See https://thinc.ai/docs/usage-frameworks
  
      hf_device = model.shims[0]._hfmodel.transformer.device
      kwargs = {
          "input_ids": xp2torch(wps.input_ids, device=hf_device),
          "attention_mask": xp2torch(
              wps.attention_mask, device=hf_device
          ),
      }
      if wps.token_type_ids is not None:
          kwargs["token_type_ids"] = xp2torch(
              wps.token_type_ids, device=hf_device
          )
      return ArgsKwargs(args=(), kwargs=kwargs), lambda dX: []
  
imports: from typing import List, Tuple, Callable, Union, Dict
  import copy
  from pathlib import Path
  from transformers.file_utils import ModelOutput
  from transformers import AutoConfig, AutoModel, AutoTokenizer
  from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
  from transformers.tokenization_utils import BatchEncoding
  from spacy.tokens import Doc
  from thinc.api import Model, get_torch_default_device, xp2torch
  from thinc.types import ArgsKwargs
  import logging
  from ..data_classes import FullTransformerBatch, WordpieceBatch, HFObjects
  from ..util import maybe_flush_pytorch_cache
  from ..util import log_gpu_memory, log_batch_size
  from ..layers._util import replace_listener, replace_listener_cfg
  from ..truncate import truncate_oversize_splits
  from ..align import get_alignment, get_alignment_via_offset_mapping
  from .hf_wrapper import HFWrapper
label_desc: Use image node_id 5 for calling a global function with example usage: _convert_transformer_inputs(model, wps, is_train) and returns: ArgsKwargs,  function