class_docstr: A class providing helper methods for saving and loading module weights.
class_docstr_tok: ["A","class","providing","helper","methods","for","saving","and","loading","module","weights","."]
code: def load_weights_config(self, save_directory):
      config_file = join(save_directory, self.config_name)
      logger.info(
          "Loading module configuration from {}".format(config_file)
      )
      # Load the config
      with open(config_file, "r", encoding="utf-8") as f:
          loaded_config = json.load(f)
      # For older versions translate the activation function to the new format
      if "version" not in loaded_config:
          if (
              "config" in loaded_config
              and loaded_config["config"] is not None
          ):
              if (
                  "non_linearity" in loaded_config["config"]
                  and loaded_config["config"]["non_linearity"]
                  in ACTIVATION_RENAME
              ):
                  loaded_config["config"][
                      "non_linearity"
                  ] = ACTIVATION_RENAME[
                      loaded_config["config"]["non_linearity"]
                  ]
      return loaded_config
  
imports: import json
  import logging
  from abc import ABC, abstractmethod
  from os import mkdir
  from os.path import exists, isdir, isfile, join
  from typing import Callable, Mapping, Sequence, Tuple
  import torch
  from .configuration import AdapterConfig, build_full_config
  from .head_utils import STATIC_TO_FLEX_HEAD_MAP, get_head_config_and_rename_list
  from .utils import ACTIVATION_RENAME, ADAPTERFUSION_CONFIG_NAME, ADAPTERFUSION_WEIGHTS_NAME, CONFIG_NAME, HEAD_CONFIG_NAME, HEAD_WEIGHTS_NAME, WEIGHTS_NAME, AdapterType, resolve_adapter_path
label_desc: Use image node_id 6 for calling the WeightsLoaderHelper obj's underlying member method code with example usage: obj.load_weights_config(save_directory) and returns: loaded_config