class_docstr: A base tuner for LyCORIS like adapters
class_docstr_tok: ["A","base","tuner","for","LyCORIS","like","adapters"]
docstr: Deletes an existing adapter.
  
  Args:
      adapter_name (`str`): Name of the adapter to be deleted.
docstr_tok: ["Deletes","an","existing","adapter",".","Args",":","adapter_name","(","`","str","`",")",":","Name","of","the","adapter","to","be","deleted","."]
code: def delete_adapter(self, adapter_name: str) -> None:
      """
      Deletes an existing adapter.
  
      Args:
          adapter_name (`str`): Name of the adapter to be deleted.
      """
      if adapter_name not in list(self.peft_config.keys()):
          raise ValueError(f"Adapter {adapter_name} does not exist")
      del self.peft_config[adapter_name]
  
      key_list = [
          key
          for key, _ in self.model.named_modules()
          if self.prefix not in key
      ]
      new_adapter = None
      for key in key_list:
          _, target, _ = _get_submodules(self.model, key)
          if isinstance(target, LycorisLayer):
              target.delete_adapter(adapter_name)
              if new_adapter is None:
                  new_adapter = target.active_adapters[:]
  
      self.active_adapter = new_adapter or []
  
imports: from __future__ import annotations
  import warnings
  from abc import abstractmethod
  from dataclasses import dataclass, field
  from typing import Any, Dict, List, Optional, Set, Type, Union
  import torch
  import torch.nn
  from tqdm import tqdm
  from peft.config import PeftConfig
  from peft.utils import ModulesToSaveWrapper, _get_submodules
  from .tuners_utils import BaseTuner, BaseTunerLayer, check_target_module_exists
label_desc: Use image node_id 16 for calling the LycorisTuner obj's underlying member method code with example usage: obj.delete_adapter(adapter_name) without return types