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
520bb082
Commit
520bb082
authored
Nov 25, 2022
by
Patrick von Platen
Browse files
fixes tests
parent
8faa822d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
+1
-1
tests/pipelines/versatile_diffusion/test_versatile_diffusion_mega.py
...ines/versatile_diffusion/test_versatile_diffusion_mega.py
+1
-1
No files found.
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
View file @
520bb082
...
@@ -674,7 +674,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase):
...
@@ -674,7 +674,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase):
latents
=
latents
.
detach
().
cpu
().
numpy
()
latents
=
latents
.
detach
().
cpu
().
numpy
()
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
expected_slice
=
np
.
array
([
1.07
8
,
1.180
4
,
1.1
339
,
0.46
6
4
,
-
0.2
354
,
0.6
097
,
-
0.77
49
,
-
0.8
7
84
,
-
0.94
65
])
expected_slice
=
np
.
array
([
1.07
57
,
1.18
6
0
,
1.1
410
,
0.464
5
,
-
0.2
476
,
0.6
100
,
-
0.77
55
,
-
0.884
1
,
-
0.94
97
])
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
test_callback_fn
.
has_been_called
=
False
test_callback_fn
.
has_been_called
=
False
...
...
tests/pipelines/versatile_diffusion/test_versatile_diffusion_mega.py
View file @
520bb082
...
@@ -124,5 +124,5 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
...
@@ -124,5 +124,5 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
]
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
]
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.34
79
,
0.1
943
,
0.
1060
,
0.38
94
,
0.2
537
,
0.1
394
,
0.
3989
,
0.31
9
1
,
0.1
987
])
expected_slice
=
np
.
array
([
0.34
03
,
0.1
809
,
0.
0938
,
0.38
55
,
0.2
393
,
0.1
243
,
0.
4028
,
0.311
0
,
0.1
799
])
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
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