code: def from_pretrained_model(
      databunch,
      pretrained_path,
      device,
      logger,
      metrics=None,
      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,
      alpha=0.95,
      beam_size=5,
      min_length=50,
      max_length=200,
      block_trigram=True,
  ):
      model_state_dict = None
  
      model_type = databunch.model_type
  
      config_class, model_class = MODEL_CLASSES[model_type]
  
      if torch.cuda.is_available():
          map_location = lambda storage, loc: storage.cuda()
      else:
          map_location = "cpu"
  
      if finetuned_wgts_path:
          model_state_dict = torch.load(
              finetuned_wgts_path, map_location=map_location
          )
      else:
          model_state_dict = None
  
      model = model_class.from_pretrained(
          str(pretrained_path), state_dict=model_state_dict
      )
  
      model.to(device)
  
      return BertAbsLearner(
          databunch,
          model,
          str(pretrained_path),
          device,
          logger,
          metrics,
          multi_gpu,
          is_fp16,
          loss_scale,
          warmup_steps,
          fp16_opt_level,
          grad_accumulation_steps,
          max_grad_norm,
          adam_epsilon,
          logging_steps,
          alpha,
          beam_size,
          min_length,
          max_length,
          block_trigram,
      )
  
imports: import os
  from .data_abs import BertAbsDataBunch
  from .learner_util import Learner
  from torch import nn
  from typing import List
  import torch
  from box import Box
  from tokenizers import BertWordPieceTokenizer
  from .summarisation import BertAbs, build_predictor
  from .summarisation import BertAbsConfig
  from fastprogress.fastprogress import master_bar, progress_bar
  import numpy
  import pandas
  from pathlib import Path
label_desc: Use image node_id 1 for calling the BertAbsLearner obj's underlying member method code with example usage: obj.from_pretrained_model(databunch, pretrained_path, device, logger, metrics, finetuned_wgts_path, multi_gpu, is_fp16, loss_scale, warmup_steps, fp16_opt_level, grad_accumulation_steps, max_grad_norm, adam_epsilon, logging_steps, alpha, beam_size, min_length, max_length, block_trigram) and returns: BertAbsLearner