File size: 972 Bytes
510ab6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Trainer exports loaded on demand.

Keeping this package initializer dependency-free lets the standalone
Predictor-v4 path run without importing the legacy wandb-based trainers.
"""

from __future__ import annotations

from importlib import import_module


_EXPORTS = {
    "DiffusionTrainer": ("trainer.diffusion", "Trainer"),
    "GANTrainer": ("trainer.gan", "Trainer"),
    "ODETrainer": ("trainer.ode", "Trainer"),
    "ScoreDistillationTrainer": ("trainer.distillation", "Trainer"),
    "PredictorV4Trainer": ("trainer.predictor_v4", "Trainer"),
    "PredictorV4RolloutTrainer": ("trainer.predictor_v4_rollout", "Trainer"),
    "PredictorV4DMDTrainer": ("trainer.predictor_v4_dmd", "Trainer"),
}

__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