code: def load(in_path: str):
      summarizer_path = os.path.join(in_path, "summarizer.pkl")
      encoder_path = os.path.join(in_path, "encoder")
      decoder_path = os.path.join(in_path, "decoder")
      with open(summarizer_path, "rb") as handle:
          summarizer = pickle.load(handle)
      summarizer.logger = get_logger(__name__)
      summarizer.transformer = Transformer(
          num_layers_encoder=summarizer.num_layers_encoder,
          num_layers_decoder=summarizer.num_layers_decoder,
          num_heads=summarizer.num_heads,
          feed_forward_dim=summarizer.feed_forward_dim,
          embedding_shape_encoder=summarizer.embedding_shape_in,
          embedding_shape_decoder=summarizer.embedding_shape_out,
          bert_embedding_encoder=summarizer.bert_embedding_encoder,
          embedding_encoder_trainable=summarizer.embedding_encoder_trainable,
          embedding_decoder_trainable=summarizer.embedding_decoder_trainable,
          dropout_rate=summarizer.dropout_rate,
      )
      optimizer_encoder = BertSummarizer.new_optimizer_encoder()
      optimizer_decoder = BertSummarizer.new_optimizer_decoder()
      summarizer.transformer.encoder.compile(
          optimizer=optimizer_encoder
      )
      summarizer.transformer.decoder.compile(
          optimizer=optimizer_decoder
      )
      summarizer.transformer.encoder.load_weights(encoder_path)
      summarizer.transformer.decoder.load_weights(decoder_path)
      summarizer.optimizer_encoder = (
          summarizer.transformer.encoder.optimizer
      )
      summarizer.optimizer_decoder = (
          summarizer.transformer.decoder.optimizer
      )
      return summarizer
  
imports: import os
  import pickle
  from typing import Callable
  from typing import Dict, Union
  import numpy
  import tensorflow
  from headliner.model.bert_model import Transformer, create_masks
  from headliner.model.summarizer import Summarizer
  from headliner.preprocessing.bert_vectorizer import BertVectorizer
  from headliner.preprocessing.preprocessor import Preprocessor
  from headliner.utils.logger import get_logger
label_desc: Use image node_id 8 for calling the BertSummarizer obj's underlying member method code with example usage: obj.load(in_path) and returns: summarizer