def save_pretrained(self, save_directory, **kwargs):
        r"""
        This method saves the configuration of your adapter model in a directory.

        Args:
            save_directory (`str`):
                The directory where the configuration will be saved.
        """
        if os.path.isfile(save_directory):
            raise AssertionError(f'Provided path ({save_directory}) should be a directory, not a file')

        os.makedirs(save_directory, exist_ok=True)

        output_dict = self.__dict__
        output_dict.update(kwargs)
        output_path = os.path.join(save_directory, CONFIG_NAME)

        # save it
        with open(output_path, 'w', encoding='utf-8') as writer:
            writer.write(json.dumps(output_dict, indent=2, sort_keys=True))

        This method saves the configuration of your adapter model in a directory.

        Args:
            save_directory (`str`):
                The directory where the configuration will be saved.
        
swift/tuners/utils.py