MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / init_hf_modules

Function init_hf_modules

src/diffusers/utils/dynamic_modules_utils.py:50–62  ·  view source on GitHub ↗

Creates the cache directory for modules with an init, and adds it to the Python path.

()

Source from the content-addressed store, hash-verified

48
49
50def init_hf_modules():
51 """
52 Creates the cache directory for modules with an init, and adds it to the Python path.
53 """
54 # This function has already been executed if HF_MODULES_CACHE already is in the Python path.
55 if HF_MODULES_CACHE in sys.path:
56 return
57
58 sys.path.append(HF_MODULES_CACHE)
59 os.makedirs(HF_MODULES_CACHE, exist_ok=True)
60 init_path = Path(HF_MODULES_CACHE) / "__init__.py"
61 if not init_path.exists():
62 init_path.touch()
63
64
65def create_dynamic_module(name: Union[str, os.PathLike]):

Callers 1

create_dynamic_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected