Skip to content

Commit 04ad948

Browse files
make style 2 - sorry
1 parent 97ef5e0 commit 04ad948

File tree

8 files changed

+34
-15
lines changed

8 files changed

+34
-15
lines changed

examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ def __getitem__(self, i):
336336

337337
if self.center_crop:
338338
crop = min(img.shape[0], img.shape[1])
339-
(h, w,) = (
339+
(
340+
h,
341+
w,
342+
) = (
340343
img.shape[0],
341344
img.shape[1],
342345
)

examples/textual_inversion/textual_inversion.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,10 @@ def __getitem__(self, i):
432432

433433
if self.center_crop:
434434
crop = min(img.shape[0], img.shape[1])
435-
(h, w,) = (
435+
(
436+
h,
437+
w,
438+
) = (
436439
img.shape[0],
437440
img.shape[1],
438441
)

examples/textual_inversion/textual_inversion_flax.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ def __getitem__(self, i):
306306

307307
if self.center_crop:
308308
crop = min(img.shape[0], img.shape[1])
309-
(h, w,) = (
309+
(
310+
h,
311+
w,
312+
) = (
310313
img.shape[0],
311314
img.shape[1],
312315
)

src/diffusers/models/attention.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ def set_use_memory_efficient_attention_xformers(
9494
if use_memory_efficient_attention_xformers:
9595
if not is_xformers_available():
9696
raise ModuleNotFoundError(
97-
"Refer to https://github.com/facebookresearch/xformers for more information on how to install"
98-
" xformers",
97+
(
98+
"Refer to https://github.com/facebookresearch/xformers for more information on how to install"
99+
" xformers"
100+
),
99101
name="xformers",
100102
)
101103
elif not torch.cuda.is_available():

src/diffusers/models/cross_attention.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ def set_use_memory_efficient_attention_xformers(
111111
)
112112
elif not is_xformers_available():
113113
raise ModuleNotFoundError(
114-
"Refer to https://github.com/facebookresearch/xformers for more information on how to install"
115-
" xformers",
114+
(
115+
"Refer to https://github.com/facebookresearch/xformers for more information on how to install"
116+
" xformers"
117+
),
116118
name="xformers",
117119
)
118120
elif not torch.cuda.is_available():

src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ def step(
189189
or isinstance(timestep, torch.LongTensor)
190190
):
191191
raise ValueError(
192-
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
193-
" `EulerDiscreteScheduler.step()` is not supported. Make sure to pass"
194-
" one of the `scheduler.timesteps` as a timestep.",
192+
(
193+
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
194+
" `EulerDiscreteScheduler.step()` is not supported. Make sure to pass"
195+
" one of the `scheduler.timesteps` as a timestep."
196+
),
195197
)
196198

197199
if not self.is_scale_input_called:

src/diffusers/schedulers/scheduling_euler_discrete.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,11 @@ def step(
198198
or isinstance(timestep, torch.LongTensor)
199199
):
200200
raise ValueError(
201-
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
202-
" `EulerDiscreteScheduler.step()` is not supported. Make sure to pass"
203-
" one of the `scheduler.timesteps` as a timestep.",
201+
(
202+
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
203+
" `EulerDiscreteScheduler.step()` is not supported. Make sure to pass"
204+
" one of the `scheduler.timesteps` as a timestep."
205+
),
204206
)
205207

206208
if not self.is_scale_input_called:

tests/test_scheduler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,10 @@ def test_scheduler_public_api(self):
537537
)
538538
self.assertTrue(
539539
hasattr(scheduler, "scale_model_input"),
540-
f"{scheduler_class} does not implement a required class method `scale_model_input(sample,"
541-
" timestep)`",
540+
(
541+
f"{scheduler_class} does not implement a required class method `scale_model_input(sample,"
542+
" timestep)`"
543+
),
542544
)
543545
self.assertTrue(
544546
hasattr(scheduler, "step"),

0 commit comments

Comments
 (0)