class_docstr: A class providing methods for saving and loading adapter modules from the Hub, the filesystem or a remote url.
  
  Model classes passed to this loader must implement the `ModelAdaptersMixin` class.
class_docstr_tok: ["A","class","providing","methods","for","saving","and","loading","adapter","modules","from","the","Hub",",","the","filesystem","or","a","remote","url",".","Model","classes","passed","to","this","loader","must","implement","the","`","ModelAdaptersMixin","`","class","."]
docstr: Saves an adapter and its configuration file to a directory, so that it can be reloaded using the `load()`
  method.
  
  Args:
      save_directory (str): a path to a directory where the adapter will be saved
      task_name (str): the name of the adapter to be saved
code: def save(self, save_directory, name, meta_dict=None):
      """
      Saves an adapter and its configuration file to a directory, so that it can be reloaded using the `load()`
      method.
  
      Args:
          save_directory (str): a path to a directory where the adapter will be saved
          task_name (str): the name of the adapter to be saved
      """
      if not exists(save_directory):
          mkdir(save_directory)
      else:
          assert isdir(
              save_directory
          ), "Saving path should be a directory where adapter and configuration can be saved."
      assert (
          name in self.model.adapters_config.adapters
      ), "No adapter of this type with the given name is part of this model."
  
      adapter_config = self.model.adapters_config.get(name)
  
      config_dict = build_full_config(
          adapter_config,
          self.model.config,
          model_name=self.model.model_name,
          name=name,
          model_class=self.model.__class__.__name__,
      )
  
      # Save the adapter configuration
      self.weights_helper.save_weights_config(
          save_directory, config_dict, meta_dict=meta_dict
      )
  
      # Save adapter weights
      filter_func = self.filter_func(config_dict["name"])
      self.weights_helper.save_weights(save_directory, filter_func)
  
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 7 for calling the AdapterLoader obj's underlying member method code with example usage: obj.save(save_directory, name, meta_dict) without return types