MCPcopy Index your code
hub / github.com/huggingface/diffusers / create_dynamic_module

Function create_dynamic_module

src/diffusers/utils/dynamic_modules_utils.py:67–79  ·  view source on GitHub ↗

Creates a dynamic module in the cache directory for modules.

(name: str | os.PathLike)

Source from the content-addressed store, hash-verified

65
66
67def create_dynamic_module(name: str | os.PathLike):
68 """
69 Creates a dynamic module in the cache directory for modules.
70 """
71 init_hf_modules()
72 dynamic_module_path = Path(HF_MODULES_CACHE) / name
73 # If the parent module does not exist yet, recursively create it.
74 if not dynamic_module_path.parent.exists():
75 create_dynamic_module(dynamic_module_path.parent)
76 os.makedirs(dynamic_module_path, exist_ok=True)
77 init_path = dynamic_module_path / "__init__.py"
78 if not init_path.exists():
79 init_path.touch()
80
81
82def get_relative_imports(module_file):

Callers 1

get_cached_module_fileFunction · 0.85

Calls 2

init_hf_modulesFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…