From 589931ca791deb8f896ee291ee481070755faa26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tolga=20Cang=C3=B6z?= <46008593+tolgacangoz@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:35:45 +0300 Subject: [PATCH] Errata - Update class method convention to use `cls` (#8574) * Class methods are supposed to use `cls` conventionally * `make style && make quality` * An Empty commit --------- Co-authored-by: Sayak Paul --- examples/community/lpw_stable_diffusion_xl.py | 4 ++-- examples/community/pipeline_demofusion_sdxl.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/community/lpw_stable_diffusion_xl.py b/examples/community/lpw_stable_diffusion_xl.py index f1711f4efd..0fb49527a4 100644 --- a/examples/community/lpw_stable_diffusion_xl.py +++ b/examples/community/lpw_stable_diffusion_xl.py @@ -2165,7 +2165,7 @@ class SDXLLongPromptWeightingPipeline( @classmethod def save_lora_weights( - self, + cls, save_directory: Union[str, os.PathLike], unet_lora_layers: Dict[str, Union[torch.nn.Module, torch.Tensor]] = None, text_encoder_lora_layers: Dict[str, Union[torch.nn.Module, torch.Tensor]] = None, @@ -2188,7 +2188,7 @@ class SDXLLongPromptWeightingPipeline( state_dict.update(pack_weights(text_encoder_lora_layers, "text_encoder")) state_dict.update(pack_weights(text_encoder_2_lora_layers, "text_encoder_2")) - self.write_lora_layers( + cls.write_lora_layers( state_dict=state_dict, save_directory=save_directory, is_main_process=is_main_process, diff --git a/examples/community/pipeline_demofusion_sdxl.py b/examples/community/pipeline_demofusion_sdxl.py index e02682dff5..e85ea1612d 100644 --- a/examples/community/pipeline_demofusion_sdxl.py +++ b/examples/community/pipeline_demofusion_sdxl.py @@ -1339,7 +1339,7 @@ class DemoFusionSDXLPipeline( @classmethod def save_lora_weights( - self, + cls, save_directory: Union[str, os.PathLike], unet_lora_layers: Dict[str, Union[torch.nn.Module, torch.Tensor]] = None, text_encoder_lora_layers: Dict[str, Union[torch.nn.Module, torch.Tensor]] = None, @@ -1368,7 +1368,7 @@ class DemoFusionSDXLPipeline( state_dict.update(pack_weights(text_encoder_lora_layers, "text_encoder")) state_dict.update(pack_weights(text_encoder_2_lora_layers, "text_encoder_2")) - self.write_lora_layers( + cls.write_lora_layers( state_dict=state_dict, save_directory=save_directory, is_main_process=is_main_process,