File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1- from ...utils import is_torch_available , is_transformers_available
1+ from ...utils import (
2+ OptionalDependencyNotAvailable ,
3+ is_torch_available ,
4+ is_transformers_available ,
5+ is_transformers_version ,
6+ )
27
38
4- if is_transformers_available () and is_torch_available ():
9+ try :
10+ if not (is_transformers_available () and is_torch_available () and is_transformers_version (">=" , "4.25.0" )):
11+ raise OptionalDependencyNotAvailable ()
12+ except OptionalDependencyNotAvailable :
13+ from ...utils .dummy_torch_and_transformers_objects import UnCLIPPipeline
14+ else :
515 from .pipeline_unclip import UnCLIPPipeline
6- from .text_proj import UnCLIPTextProjModel
Original file line number Diff line number Diff line change @@ -359,6 +359,7 @@ def requires_backends(obj, backends):
359359 "VersatileDiffusionPipeline" ,
360360 "VersatileDiffusionDualGuidedPipeline" ,
361361 "StableDiffusionImageVariationPipeline" ,
362+ "UnCLIPPipeline" ,
362363 ] and is_transformers_version ("<" , "4.25.0" ):
363364 raise ImportError (
364365 f"You need to install `transformers>=4.25` in order to use { name } : \n ```\n pip install"
You can’t perform that action at this time.
0 commit comments