class_docstr: A base tuner for LyCORIS like adapters
class_docstr_tok: ["A","base","tuner","for","LyCORIS","like","adapters"]
docstr: This method merges the adapter layers into the base model. This is needed if someone wants to use the base
  model as a standalone model.
  
  Args:
      progressbar (`bool`):
          whether to show a progressbar indicating the unload and merge process
      safe_merge (`bool`):
          whether to activate the safe merging check to check if there is any potential Nan in the adapter
          weights
      adapter_names (`List[str]`, *optional*):
          The list of adapter names that should be merged. If None, all active adapters will be merged. Defaults
          to `None`.
docstr_tok: ["This","method","merges","the","adapter","layers","into","the","base","model",".","This","is","needed","if","someone","wants","to","use","the","base","model","as","a","standalone","model",".","Args",":","progressbar","(","`","bool","`",")",":","whether","to","show","a","progressbar","indicating","the","unload","and","merge","process","safe_merge","(","`","bool","`",")",":","whether","to","activate","the","safe","merging","check","to","check","if","there","is","any","potential","Nan","in","the","adapter","weights","adapter_names","(","`","List","[","str","]","`",",","*","optional","*",")",":","The","list","of","adapter","names","that","should","be","merged",".","If","None",",","all","active","adapters","will","be","merged",".","Defaults","to","`","None","`","."]
code: def merge_and_unload(
      self,
      progressbar: bool = False,
      safe_merge: bool = False,
      adapter_names: Optional[List[str]] = None,
  ) -> torch.nn.Module:
      r"""
      This method merges the adapter layers into the base model. This is needed if someone wants to use the base
      model as a standalone model.
  
      Args:
          progressbar (`bool`):
              whether to show a progressbar indicating the unload and merge process
          safe_merge (`bool`):
              whether to activate the safe merging check to check if there is any potential Nan in the adapter
              weights
          adapter_names (`List[str]`, *optional*):
              The list of adapter names that should be merged. If None, all active adapters will be merged. Defaults
              to `None`.
  
      """
      return self._unload_and_optionally_merge(
          progressbar=progressbar,
          safe_merge=safe_merge,
          adapter_names=adapter_names,
      )
  
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 13 for calling the LycorisTuner obj's underlying member method code with example usage: obj.merge_and_unload(progressbar, safe_merge, adapter_names) and returns: self