code: def convert_tf_assets(tf_assets_dir, model_type):
      """Convert the assets file including config, vocab and tokenizer model"""
      file_names = os.listdir(tf_assets_dir)
      json_cfg_path = None
      spm_model_path = None
      vocab_path = None
      for ele in file_names:
          if ele.endswith(".model"):
              assert spm_model_path is None
              spm_model_path = ele
          elif ele.endswith(".json"):
              assert json_cfg_path is None
              json_cfg_path = ele
          elif ele.endswith(".txt"):
              assert vocab_path is None
              vocab_path = ele
      assert json_cfg_path is not None and (
          spm_model_path is not None or vocab_path is not None
      ), (
          "The file to be"
          "converted is missing and at least one word segmentation tool or dictionary exists"
      )
  
      json_cfg_path = os.path.join(tf_assets_dir, json_cfg_path)
      if spm_model_path:
          spm_model_path = os.path.join(tf_assets_dir, spm_model_path)
          tokenizer = SentencepieceTokenizer(spm_model_path)
          vocab_size = len(tokenizer.vocab)
      elif vocab_path:
          vocab_path = os.path.join(tf_assets_dir, vocab_path)
          vocab_size = len(
              open(vocab_path, "r", encoding="utf-8").readlines()
          )
      cfg = convert_tf_config(json_cfg_path, vocab_size, model_type)
      return cfg, vocab_path, spm_model_path
  
imports: import tensorflow_hub
  import tensorflow.compat.v1
  import os
  import re
  import json
  import shutil
  import logging
  import argparse
  import mxnet
  import torch
  import numpy
  from numpy.testing import assert_allclose
  from gluonnlp.data.vocab import Vocab
  from gluonnlp.utils.misc import naming_convention, logging_config, BooleanOptionalAction
  from gluonnlp.models.bert import BertModel, BertForMLM
  from gluonnlp.models.albert import AlbertModel, AlbertForMLM
  from gluonnlp.torch.models.bert import BertModel, BertForMLM
  from gluonnlp.data.tokenizers import SentencepieceTokenizer, HuggingFaceWordPieceTokenizer
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: convert_tf_assets(tf_assets_dir, model_type) and returns: cfg,  vocab_path,  spm_model_path