Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
97ef5e06
Commit
97ef5e06
authored
Jan 27, 2023
by
Patrick von Platen
Browse files
make style
parent
31be4220
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
34 deletions
+15
-34
examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py
...ts/intel_opts/textual_inversion/textual_inversion_bf16.py
+1
-4
examples/textual_inversion/textual_inversion.py
examples/textual_inversion/textual_inversion.py
+1
-4
examples/textual_inversion/textual_inversion_flax.py
examples/textual_inversion/textual_inversion_flax.py
+1
-4
src/diffusers/models/attention.py
src/diffusers/models/attention.py
+2
-4
src/diffusers/models/cross_attention.py
src/diffusers/models/cross_attention.py
+2
-4
src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py
...ffusers/schedulers/scheduling_euler_ancestral_discrete.py
+3
-5
src/diffusers/schedulers/scheduling_euler_discrete.py
src/diffusers/schedulers/scheduling_euler_discrete.py
+3
-5
tests/test_scheduler.py
tests/test_scheduler.py
+2
-4
No files found.
examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py
View file @
97ef5e06
...
...
@@ -336,10 +336,7 @@ 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
],
)
...
...
examples/textual_inversion/textual_inversion.py
View file @
97ef5e06
...
...
@@ -432,10 +432,7 @@ 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
],
)
...
...
examples/textual_inversion/textual_inversion_flax.py
View file @
97ef5e06
...
...
@@ -306,10 +306,7 @@ 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
],
)
...
...
src/diffusers/models/attention.py
View file @
97ef5e06
...
...
@@ -94,10 +94,8 @@ 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
():
...
...
src/diffusers/models/cross_attention.py
View file @
97ef5e06
...
...
@@ -111,10 +111,8 @@ 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
():
...
...
src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py
View file @
97ef5e06
...
...
@@ -189,11 +189,9 @@ 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
:
...
...
src/diffusers/schedulers/scheduling_euler_discrete.py
View file @
97ef5e06
...
...
@@ -198,11 +198,9 @@ 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
:
...
...
tests/test_scheduler.py
View file @
97ef5e06
...
...
@@ -537,10 +537,8 @@ 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"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment