code: def convert_from_transformers():
      # CASE 1: MODEL
      # Load model from transformers model hub (-> continue training / compare models / ...)
      model = Converter.convert_from_transformers(
          "deepset/bert-large-uncased-whole-word-masking-squad2",
          device="cpu",
      )
      # Alternative way to load from transformers model hub:
      # model = AdaptiveModel.convert_from_transformers("deepset/bert-large-uncased-whole-word-masking-squad2", device="cpu", task_type="question_answering")
      # ... continue as in the other examples e.g. to fine-tune this QA model on your own data
  
      # CASE 2: INFERENCER
      # Load Inferencer from transformers, incl. model & tokenizer (-> just get predictions)
      nlp = Inferencer.load(
          "deepset/bert-large-uncased-whole-word-masking-squad2",
          task_type="question_answering",
      )
  
      # run predictions
      QA_input = [
          {
              "questions": ["Why is model conversion important?"],
              "text": "The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.",
          }
      ]
      result = nlp.inference_from_dicts(dicts=QA_input)
      pprint.pprint(result)
      nlp.close_multiprocessing_pool()
  
      # save it
      farm_model_dir = Path("../saved_models/bert-english-qa-large")
      nlp.save(farm_model_dir)
  
file_path: FARM/examples/conversion_huggingface_models.py
imports: from farm.modeling.adaptive_model import AdaptiveModel
  from farm.modeling.tokenization import Tokenizer
  from farm.conversion.transformers import Converter
  from farm.infer import Inferencer
  import pprint
  from transformers.pipelines import pipeline
  import os
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: convert_from_transformers() without return types