code: def from_pretrained_model(
      databunch,
      pretrained_path,
      output_dir,
      device,
      logger,
      finetuned_wgts_path=None,
      multi_gpu=True,
      is_fp16=True,
      loss_scale=0,
      warmup_steps=0,
      fp16_opt_level="O1",
      grad_accumulation_steps=1,
      max_grad_norm=1.0,
      adam_epsilon=1e-8,
      logging_steps=100,
      save_steps=0,
  ):
      if is_fp16 and (IS_AMP_AVAILABLE is False):
          logger.debug(
              "Apex not installed. switching off FP16 training"
          )
          is_fp16 = False
  
      model = load_model(
          databunch, pretrained_path, finetuned_wgts_path, device
      )
  
      return BertNERLearner(
          databunch,
          model,
          str(pretrained_path),
          output_dir,
          device,
          logger,
          multi_gpu,
          is_fp16,
          loss_scale,
          warmup_steps,
          fp16_opt_level,
          grad_accumulation_steps,
          max_grad_norm,
          adam_epsilon,
          logging_steps,
          save_steps,
      )
  
imports: import os
  import logging
  import torch
  import numpy
  from .data_ner import BertNERDataBunch
  from torch import nn
  from seqeval.metrics import f1_score, precision_score, recall_score
  from typing import Dict, List, Optional, Tuple
  from .learner_util import Learner
  from transformers import AutoConfig, AutoModelForTokenClassification, Trainer, TrainingArguments, EvalPrediction, HfArgumentParser
label_desc: Use image node_id 1 for calling the BertNERLearner obj's underlying member method code with example usage: obj.from_pretrained_model(databunch, pretrained_path, output_dir, device, logger, finetuned_wgts_path, multi_gpu, is_fp16, loss_scale, warmup_steps, fp16_opt_level, grad_accumulation_steps, max_grad_norm, adam_epsilon, logging_steps, save_steps) and returns: BertNERLearner