how to move DIFFUSERS_CACHE to new version #9965
-
ImportError: cannot import name 'DIFFUSERS_CACHE' from 'diffusers.utils' The old code is from diffusers.utils import (
CONFIG_NAME,
DEPRECATED_REVISION_ARGS,
DIFFUSERS_CACHE,
)
class DiffusionPipeline(ConfigMixin, PushToHubMixin):
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
cache_dir = kwargs.pop("cache_dir", DIFFUSERS_CACHE)
cached_folder = cls.download(
pretrained_model_name_or_path,
cache_dir=cache_dir, How to modify the old code? |
Beta Was this translation helpful? Give feedback.
Answered by
asomoza
Nov 23, 2024
Replies: 1 comment 3 replies
-
Hi, it's not clear what you want to do, if it's old code it should work with the corresponding diffusers version, the newer versions don't use that constant anymore but you can just use the import for the If you want to learn how to convert the old code (which I don't really know why) you can just look at the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cache_dir
as the docstring says is:you can set it to
none
if you just want to use the default cache directory thehuggingface_hub
library uses.