diff --git a/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py b/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py index a1aff1d91c..f20db249ec 100644 --- a/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py +++ b/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py @@ -336,7 +336,10 @@ class TextualInversionDataset(Dataset): if self.center_crop: crop = min(img.shape[0], img.shape[1]) - (h, w,) = ( + ( + h, + w, + ) = ( img.shape[0], img.shape[1], ) diff --git a/examples/textual_inversion/textual_inversion.py b/examples/textual_inversion/textual_inversion.py index d6c27444e0..1c4bd235e6 100644 --- a/examples/textual_inversion/textual_inversion.py +++ b/examples/textual_inversion/textual_inversion.py @@ -432,7 +432,10 @@ class TextualInversionDataset(Dataset): if self.center_crop: crop = min(img.shape[0], img.shape[1]) - (h, w,) = ( + ( + h, + w, + ) = ( img.shape[0], img.shape[1], ) diff --git a/examples/textual_inversion/textual_inversion_flax.py b/examples/textual_inversion/textual_inversion_flax.py index 69637c3645..b37d1e2ac4 100644 --- a/examples/textual_inversion/textual_inversion_flax.py +++ b/examples/textual_inversion/textual_inversion_flax.py @@ -306,7 +306,10 @@ class TextualInversionDataset(Dataset): if self.center_crop: crop = min(img.shape[0], img.shape[1]) - (h, w,) = ( + ( + h, + w, + ) = ( img.shape[0], img.shape[1], ) diff --git a/src/diffusers/models/attention.py b/src/diffusers/models/attention.py index ec5d6fdb38..b5acd6f4f9 100644 --- a/src/diffusers/models/attention.py +++ b/src/diffusers/models/attention.py @@ -94,8 +94,10 @@ class AttentionBlock(nn.Module): if use_memory_efficient_attention_xformers: if not is_xformers_available(): raise ModuleNotFoundError( - "Refer to https://github.com/facebookresearch/xformers for more information on how to install" - " xformers", + ( + "Refer to https://github.com/facebookresearch/xformers for more information on how to install" + " xformers" + ), name="xformers", ) elif not torch.cuda.is_available(): diff --git a/src/diffusers/models/cross_attention.py b/src/diffusers/models/cross_attention.py index 5f0777327d..a1d77f66ef 100644 --- a/src/diffusers/models/cross_attention.py +++ b/src/diffusers/models/cross_attention.py @@ -111,8 +111,10 @@ class CrossAttention(nn.Module): ) elif not is_xformers_available(): raise ModuleNotFoundError( - "Refer to https://github.com/facebookresearch/xformers for more information on how to install" - " xformers", + ( + "Refer to https://github.com/facebookresearch/xformers for more information on how to install" + " xformers" + ), name="xformers", ) elif not torch.cuda.is_available(): diff --git a/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py b/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py index de5203e793..45f939aafe 100644 --- a/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py +++ b/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py @@ -189,9 +189,11 @@ class EulerAncestralDiscreteScheduler(SchedulerMixin, ConfigMixin): or isinstance(timestep, torch.LongTensor) ): raise ValueError( - "Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to" - " `EulerDiscreteScheduler.step()` is not supported. Make sure to pass" - " one of the `scheduler.timesteps` as a timestep.", + ( + "Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to" + " `EulerDiscreteScheduler.step()` is not supported. Make sure to pass" + " one of the `scheduler.timesteps` as a timestep." + ), ) if not self.is_scale_input_called: diff --git a/src/diffusers/schedulers/scheduling_euler_discrete.py b/src/diffusers/schedulers/scheduling_euler_discrete.py index 32adf5a61c..02e5c2cd99 100644 --- a/src/diffusers/schedulers/scheduling_euler_discrete.py +++ b/src/diffusers/schedulers/scheduling_euler_discrete.py @@ -198,9 +198,11 @@ class EulerDiscreteScheduler(SchedulerMixin, ConfigMixin): or isinstance(timestep, torch.LongTensor) ): raise ValueError( - "Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to" - " `EulerDiscreteScheduler.step()` is not supported. Make sure to pass" - " one of the `scheduler.timesteps` as a timestep.", + ( + "Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to" + " `EulerDiscreteScheduler.step()` is not supported. Make sure to pass" + " one of the `scheduler.timesteps` as a timestep." + ), ) if not self.is_scale_input_called: diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 9d74cac698..d49d599c57 100755 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -537,8 +537,10 @@ class SchedulerCommonTest(unittest.TestCase): ) self.assertTrue( hasattr(scheduler, "scale_model_input"), - f"{scheduler_class} does not implement a required class method `scale_model_input(sample," - " timestep)`", + ( + f"{scheduler_class} does not implement a required class method `scale_model_input(sample," + " timestep)`" + ), ) self.assertTrue( hasattr(scheduler, "step"),