File size: 1,081 Bytes
d5e0d8f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | """Public model exports loaded on demand.
Lazy imports preserve the existing ``from model import DMD`` API while avoiding
the model/pipeline cycle introduced by the standalone Predictor module.
"""
from __future__ import annotations
from importlib import import_module
_EXPORTS = {
"CausalDiffusion": ("model.diffusion", "CausalDiffusion"),
"CausVid": ("model.causvid", "CausVid"),
"DMD": ("model.dmd", "DMD"),
"GAN": ("model.gan", "GAN"),
"SiD": ("model.sid", "SiD"),
"ODERegression": ("model.ode_regression", "ODERegression"),
"SelfForcingPredictorV4": (
"model.predictor_v4",
"SelfForcingPredictorV4",
),
"TripleFeatureFusion": ("model.predictor_v4", "TripleFeatureFusion"),
"WanPredictorV4Config": ("model.predictor_v4", "WanPredictorV4Config"),
}
__all__ = list(_EXPORTS)
def __getattr__(name: str):
if name not in _EXPORTS:
raise AttributeError(name)
module_name, attribute = _EXPORTS[name]
value = getattr(import_module(module_name), attribute)
globals()[name] = value
return value
|