MCPcopy Create free account
hub / github.com/AlayaLab/Hive / init_hf_modules

Function init_hf_modules

models/flowsep/diffusers/utils/dynamic_modules_utils.py:49–61  ·  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

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

Callers 1

create_dynamic_moduleFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected