code: def test_conversion_inferencer_ner():
      # input
      text = "Paris is a town in France."
  
      # Load from model hub
      model = "dslim/bert-base-NER"
      nlp = Inferencer.load(model, task_type="ner", num_processes=0)
  
      assert nlp.processor.tokenizer.do_lower_case == False
      assert nlp.processor.tokenizer.is_fast == True
  
      input = [{"text": text}]
      result_farm = nlp.inference_from_dicts(dicts=input)
      pred_farm = result_farm[0]["predictions"]
      assert pred_farm[0][0]["label"] == "LOC"
      assert pred_farm[0][1]["label"] == "LOC"
      assert len(pred_farm[0]) == 2
  
      # save it
      farm_model_dir = Path("testsave/bert-conversion-test-hf")
      nlp.save(farm_model_dir)
      del nlp
  
      # load from disk in FARM format
      model = AdaptiveModel.load(farm_model_dir, device="cpu")
      tokenizer = Tokenizer.load(farm_model_dir)
  
      # convert to transformers
      transformer_model = Converter.convert_to_transformers(model)[0]
      del model
  
      # save it (Note: transformers uses strings rather than Path objects)
      model_dir = "testsave/bert-conversion-test-hf"
      os.makedirs(model_dir, exist_ok=True)
      transformer_model.save_pretrained(model_dir)
      tokenizer.save_pretrained(model_dir)
      del transformer_model
      del tokenizer
  
      # run predictions (using transformers)
      nlp = pipeline("ner", model=model_dir, tokenizer=model_dir)
      result_transformers = nlp(text)
      assert result_transformers[0]["entity"] == "B-LOC"
      assert result_transformers[1]["entity"] == "B-LOC"
      assert len(result_transformers) == 2
      del nlp
  
file_path: FARM/test/test_conversion.py
imports: from transformers import BertForSequenceClassification, BertForTokenClassification
  from farm.modeling.adaptive_model import AdaptiveModel
  from farm.conversion.transformers import Converter
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import TextClassificationHead, TokenClassificationHead, QuestionAnsweringHead
  from farm.modeling.tokenization import Tokenizer
  from farm.infer import Inferencer
  from transformers.pipelines import pipeline
  from transformers import AutoModelForQuestionAnswering, AutoModelWithLMHead, AutoModelForSequenceClassification, AutoModelForTokenClassification
  import os
  from pathlib import Path
  import pytest
label_desc: Use image node_id 7 for calling a global function with example usage: test_conversion_inferencer_ner() without return types