MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / wrapper

Function wrapper

scripts/sd_model_zoo.py:11–18  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

9cached_models = {} # cache for models to avoid repeated loading, key is model name
10def cache_model(func):
11 def wrapper(*args, **kwargs):
12 if ENABLE_CPU_CACHE:
13 model_name = func.__name__ + str(args) + str(kwargs)
14 if model_name not in cached_models:
15 cached_models[model_name] = func(*args, **kwargs)
16 return cached_models[model_name]
17 else:
18 return func(*args, **kwargs)
19 return wrapper
20
21def copied_cache_model(func):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected