class_docstr: A class providing methods for saving and loading AdapterFusion modules from the file system.
class_docstr_tok: ["A","class","providing","methods","for","saving","and","loading","AdapterFusion","modules","from","the","file","system","."]
docstr: Loads the weights of a given AdapterFusion module from a state dict into the model.
  
  Args:
      state_dict (dict): The state dict from which to load the AdapterFusion weights.
      name (str): The name of the AdapterFusion to be loaded.
      load_as (str, optional):
          Load the AdapterFusion using this name. By default, the name with which the AdapterFusion was saved
          will be used.
      loading_info (dict, optional):
          A dictionary to which loading information (missing and unexpected keys) will be added.
      start_prefix (str, optional): A custom prefix to be ignored in the given state dict.
code: def load_from_state_dict(
      self,
      state_dict,
      name,
      load_as=None,
      loading_info=None,
      start_prefix="",
  ):
      """
      Loads the weights of a given AdapterFusion module from a state dict into the model.
  
      Args:
          state_dict (dict): The state dict from which to load the AdapterFusion weights.
          name (str): The name of the AdapterFusion to be loaded.
          load_as (str, optional):
              Load the AdapterFusion using this name. By default, the name with which the AdapterFusion was saved
              will be used.
          loading_info (dict, optional):
              A dictionary to which loading information (missing and unexpected keys) will be added.
          start_prefix (str, optional): A custom prefix to be ignored in the given state dict.
      """
      new_adapter_fusion_name = load_as or name
      if (
          new_adapter_fusion_name
          not in self.model.adapters_config.fusions
      ):
          raise ValueError(
              f"No AdapterFusion with name '{new_adapter_fusion_name}' available."
          )
  
      # Load adapter weights
      filter_func = self.filter_func(name)
      rename_func = self.rename_func(name, new_adapter_fusion_name)
      self.weights_helper.load_weights_from_state_dict(
          state_dict,
          filter_func,
          rename_func=rename_func,
          loading_info=loading_info,
          in_base_model=True,
          start_prefix=start_prefix,
      )
  
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 AdapterFusionLoader obj's underlying member method code with example usage: obj.load_from_state_dict(state_dict, name, load_as, loading_info, start_prefix) without return types