code: def load_lm_heads_from_transformers_weights(
      jiant_model, weights_dict
  ):
      mlm_weights_dict = jiant_model.encoder.get_mlm_weights_dict(
          weights_dict
      )
      missed = set()
      for (
          taskmodel_name,
          taskmodel,
      ) in jiant_model.taskmodels_dict.items():
          if not isinstance(taskmodel, MLMModel):
              continue
          mismatch = taskmodel.mlm_head.load_state_dict(
              mlm_weights_dict
          )
          assert not mismatch.missing_keys
          missed.update(mismatch.unexpected_keys)
          taskmodel.mlm_head.decoder.weight = (
              jiant_model.encoder.embeddings.word_embeddings.weight
          )
      return list(missed)
  
imports: from dataclasses import dataclass
  from typing import Any
  from typing import Dict
  from typing import List
  import torch
  import torch.nn
  import transformers
  import warnings
  import jiant.proj.main.components.container_setup
  import jiant.proj.main.modeling.primary
  import jiant.utils.python.strings
  from jiant.proj.main.modeling.heads import JiantHeadFactory
  from jiant.proj.main.modeling.taskmodels import JiantTaskModelFactory, Taskmodel, MLMModel
  from jiant.shared.model_resolution import ModelArchitectures
  from jiant.tasks.core import Task
label_desc: Use image node_id 5 for calling a global function with example usage: load_lm_heads_from_transformers_weights(jiant_model, weights_dict) and returns: list