Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
bbe8d3ae
Unverified
Commit
bbe8d3ae
authored
Oct 02, 2023
by
Dhruv Nair
Committed by
GitHub
Oct 02, 2023
Browse files
Compile test fixes (#5235)
compile test fixes
parent
907fd91c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
docker/diffusers-pytorch-compile-cuda/Dockerfile
docker/diffusers-pytorch-compile-cuda/Dockerfile
+5
-4
tests/pipelines/controlnet/test_controlnet.py
tests/pipelines/controlnet/test_controlnet.py
+4
-3
No files found.
docker/diffusers-pytorch-compile-cuda/Dockerfile
View file @
bbe8d3ae
...
@@ -14,22 +14,23 @@ RUN apt update && \
...
@@ -14,22 +14,23 @@ RUN apt update && \
libsndfile1-dev
\
libsndfile1-dev
\
libgl1
\
libgl1
\
python3.9
\
python3.9
\
python3.9-dev
\
python3-pip
\
python3-pip
\
python3.9-venv
&&
\
python3.9-venv
&&
\
rm
-rf
/var/lib/apt/lists
rm
-rf
/var/lib/apt/lists
# make sure to use venv
# make sure to use venv
RUN
python3
-m
venv /opt/venv
RUN
python3
.9
-m
venv /opt/venv
ENV
PATH="/opt/venv/bin:$PATH"
ENV
PATH="/opt/venv/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN
python3
-m
pip
install
--no-cache-dir
--upgrade
pip
&&
\
RUN
python3
.9
-m
pip
install
--no-cache-dir
--upgrade
pip
&&
\
python3
-m
pip
install
--no-cache-dir
\
python3
.9
-m
pip
install
--no-cache-dir
\
torch
\
torch
\
torchvision
\
torchvision
\
torchaudio
\
torchaudio
\
invisible_watermark
&&
\
invisible_watermark
&&
\
python3
-m
pip
install
--no-cache-dir
\
python3
.9
-m
pip
install
--no-cache-dir
\
accelerate
\
accelerate
\
datasets
\
datasets
\
hf-doc-builder
\
hf-doc-builder
\
...
...
tests/pipelines/controlnet/test_controlnet.py
View file @
bbe8d3ae
...
@@ -85,16 +85,17 @@ def _test_stable_diffusion_compile(in_queue, out_queue, timeout):
...
@@ -85,16 +85,17 @@ def _test_stable_diffusion_compile(in_queue, out_queue, timeout):
prompt
=
"bird"
prompt
=
"bird"
image
=
load_image
(
image
=
load_image
(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"
)
)
.
resize
((
512
,
512
))
output
=
pipe
(
prompt
,
image
,
generator
=
generator
,
output_type
=
"np"
)
output
=
pipe
(
prompt
,
image
,
num_inference_steps
=
10
,
generator
=
generator
,
output_type
=
"np"
)
image
=
output
.
images
[
0
]
image
=
output
.
images
[
0
]
assert
image
.
shape
==
(
768
,
512
,
3
)
assert
image
.
shape
==
(
512
,
512
,
3
)
expected_image
=
load_numpy
(
expected_image
=
load_numpy
(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny_out_full.npy"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny_out_full.npy"
)
)
expected_image
=
np
.
resize
(
expected_image
,
(
512
,
512
,
3
))
assert
np
.
abs
(
expected_image
-
image
).
max
()
<
1.0
assert
np
.
abs
(
expected_image
-
image
).
max
()
<
1.0
...
...
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