MCPcopy Create free account
hub / github.com/huggingface/diffusers / cache_context

Method cache_context

src/diffusers/models/cache_utils.py:155–164  ·  view source on GitHub ↗

r"""Context manager that provides additional methods for cache management.

(self, name: str)

Source from the content-addressed store, hash-verified

153
154 @contextmanager
155 def cache_context(self, name: str):
156 r"""Context manager that provides additional methods for cache management."""
157 from ..hooks import HookRegistry
158
159 registry = HookRegistry.check_if_exists_or_initialize(self)
160 registry._set_context(name)
161
162 yield
163
164 registry._set_context(None)

Callers 15

__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80

Calls 2

_set_contextMethod · 0.45

Tested by

no test coverage detected