code: def from_pretrained_model(
      dataBunch,
      pretrained_path,
      output_dir,
      metrics,
      device,
      logger,
      multi_gpu=True,
      is_fp16=True,
      warmup_steps=0,
      fp16_opt_level="O1",
      grad_accumulation_steps=1,
      max_grad_norm=1.0,
      adam_epsilon=1e-8,
      logging_steps=100,
  ):
      if is_fp16 and (IS_AMP_AVAILABLE is False):
          logger.debug(
              "Apex not installed. switching off FP16 training"
          )
          is_fp16 = False
  
      model_type = dataBunch.model_type
  
      config_class, model_class = MODEL_CLASSES[model_type]
  
      config = config_class.from_pretrained(pretrained_path)
      model = model_class.from_pretrained(
          pretrained_path, config=config
      )
      model.to(device)
  
      return BertLMLearner(
          dataBunch,
          model,
          pretrained_path,
          output_dir,
          metrics,
          device,
          logger,
          multi_gpu,
          is_fp16,
          warmup_steps,
          fp16_opt_level,
          grad_accumulation_steps,
          max_grad_norm,
          adam_epsilon,
          logging_steps,
      )
  
file_path: fast-bert/fast_bert/learner_lm.py
imports: import os
  import torch
  from packaging import version
  from pathlib import Path
  import numpy
  from fastprogress.fastprogress import master_bar, progress_bar
  from tensorboardX import SummaryWriter
  from .learner_util import Learner
  from .data_lm import BertLMDataBunch
  from transformers import WEIGHTS_NAME, BertConfig, BertForMaskedLM, RobertaConfig, RobertaForMaskedLM, DistilBertConfig, DistilBertForMaskedLM, CamembertConfig, CamembertForMaskedLM, ElectraConfig, ElectraForMaskedLM
  from torch.optim.lr_scheduler import _LRScheduler, Optimizer
label_desc: Use image node_id 1 for calling the BertLMLearner obj's underlying member method code with example usage: obj.from_pretrained_model(dataBunch, pretrained_path, output_dir, metrics, device, logger, multi_gpu, is_fp16, warmup_steps, fp16_opt_level, grad_accumulation_steps, max_grad_norm, adam_epsilon, logging_steps) and returns: BertLMLearner