code: def test_with_bert_finetune(pretrain_file, tmp_path):
      trainer = run_training(
          pretrain_file,
          tmp_path,
          "--bert_model",
          "hf-internal-testing/tiny-bert",
          "--bert_finetune",
      )
      model_file = os.path.join(
          trainer.args["save_dir"], trainer.args["save_name"]
      )
      assert model_file_has_bert(model_file)
  
      foo_save_filename = os.path.join(
          tmp_path, "foo_" + trainer.args["save_name"]
      )
      bar_save_filename = os.path.join(
          tmp_path, "bar_" + trainer.args["save_name"]
      )
      trainer.save(foo_save_filename)
      assert model_file_has_bert(foo_save_filename)
  
      reloaded_trainer = Trainer(
          args=trainer.args, model_file=foo_save_filename
      )
      reloaded_trainer.save(bar_save_filename)
      assert model_file_has_bert(bar_save_filename)
  
imports: import json
  import logging
  import os
  import warnings
  import pytest
  import torch
  from stanza.models import ner_tagger
  from stanza.models.ner.trainer import Trainer
  from stanza.tests import TEST_WORKING_DIR
  from stanza.utils.datasets.ner.prepare_ner_file import process_dataset
label_desc: Use image node_id 15 for calling a global function with example usage: test_with_bert_finetune(pretrain_file, tmp_path) without return types