Skip to content

Commit 97ef5e0

Browse files
make style
1 parent 31be422 commit 97ef5e0

File tree

8 files changed

+15
-34
lines changed

8 files changed

+15
-34
lines changed

examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py

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

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

examples/textual_inversion/textual_inversion.py

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

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

examples/textual_inversion/textual_inversion_flax.py

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

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

src/diffusers/models/attention.py

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

src/diffusers/models/cross_attention.py

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

src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ def step(
189189
or isinstance(timestep, torch.LongTensor)
190190
):
191191
raise ValueError(
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-
),
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.",
197195
)
198196

199197
if not self.is_scale_input_called:

src/diffusers/schedulers/scheduling_euler_discrete.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,9 @@ def step(
198198
or isinstance(timestep, torch.LongTensor)
199199
):
200200
raise ValueError(
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-
),
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.",
206204
)
207205

208206
if not self.is_scale_input_called:

tests/test_scheduler.py

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

0 commit comments

Comments
 (0)