Spaces:
Sleeping
Sleeping
| import importlib | |
| # Lazy-load all submodules to avoid circular-import errors when trellis2 is | |
| # first imported from an environment where a partial trellis2 namespace already | |
| # exists in sys.modules (e.g. registered as a dependency by o_voxel/flex_gemm). | |
| _submodules = frozenset(( | |
| 'models', 'modules', 'pipelines', | |
| 'renderers', 'representations', 'utils', | |
| )) | |
| def __getattr__(name): | |
| if name in _submodules: | |
| module = importlib.import_module(f'.{name}', __name__) | |
| globals()[name] = module | |
| return module | |
| raise AttributeError(f"module 'trellis2' has no attribute {name!r}") | |