mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
Improve transformers versions handling (#2104)
This commit is contained in:
committed by
GitHub
parent
b562b6611f
commit
008c22d334
@@ -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
|
||||
|
||||
@@ -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```"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user