MCPcopy
hub / github.com/lightningpixel/modly / load_generator

Function load_generator

api/runner.py:73–81  ·  view source on GitHub ↗

Dynamically load the generator class from generator.py.

(manifest: dict)

Source from the content-addressed store, hash-verified

71# ------------------------------------------------------------------ #
72
73def load_generator(manifest: dict):
74 """Dynamically load the generator class from generator.py."""
75 spec = importlib.util.spec_from_file_location(
76 "generator", EXT_DIR / "generator.py"
77 )
78 mod = importlib.util.module_from_spec(spec)
79 sys.modules["generator"] = mod
80 spec.loader.exec_module(mod)
81 return getattr(mod, manifest["generator_class"])
82
83
84def _select_node(manifest: dict, model_dir_override: str) -> dict:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected