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
008c22d3
Unverified
Commit
008c22d3
authored
Jan 25, 2023
by
Patrick von Platen
Committed by
GitHub
Jan 25, 2023
Browse files
Improve transformers versions handling (#2104)
parent
b562b661
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/diffusers/pipelines/stable_diffusion/__init__.py
src/diffusers/pipelines/stable_diffusion/__init__.py
+1
-1
src/diffusers/utils/import_utils.py
src/diffusers/utils/import_utils.py
+3
-3
No files found.
src/diffusers/pipelines/stable_diffusion/__init__.py
View file @
008c22d3
...
...
@@ -57,7 +57,7 @@ else:
try
:
if
not
(
is_transformers_available
()
and
is_torch_available
()
and
is_transformers_version
(
">="
,
"4.26.0
.dev0
"
)):
if
not
(
is_transformers_available
()
and
is_torch_available
()
and
is_transformers_version
(
">="
,
"4.26.0"
)):
raise
OptionalDependencyNotAvailable
()
except
OptionalDependencyNotAvailable
:
from
...utils.dummy_torch_and_transformers_objects
import
StableDiffusionDepth2ImgPipeline
...
...
src/diffusers/utils/import_utils.py
View file @
008c22d3
...
...
@@ -392,10 +392,10 @@ def requires_backends(obj, backends):
if
name
in
[
"StableDiffusionDepth2ImgPipeline"
,
]
and
is_transformers_version
(
"<"
,
"4.26.0
.dev0
"
):
]
and
is_transformers_version
(
"<"
,
"4.26.0"
):
raise
ImportError
(
f
"You need to install `transformers
` from 'main'
in order to use
{
name
}
:
\n
```
\n
pip install"
"
git+https://github.com/huggingface/
transformers
\n
```"
f
"You need to install `transformers
>=4.26`
in order to use
{
name
}
:
\n
```
\n
pip install"
"
--upgrade
transformers
\n
```"
)
...
...
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