| """Diffulex package root. |
| |
| Keep this module lightweight so that importing does not eagerly |
| import the full engine/kernel. |
| """ |
|
|
| from __future__ import annotations |
|
|
| from typing import TYPE_CHECKING |
|
|
| if TYPE_CHECKING: |
| |
| from diffulex.diffulex import Diffulex as Diffulex |
| from diffulex.sampling_params import SamplingParams as SamplingParams |
| from diffulex.logger import ( |
| get_logger as get_logger, |
| setup_logger as setup_logger, |
| LoggerMixin as LoggerMixin, |
| ) |
|
|
|
|
| def __getattr__(name: str): |
| if name == "Diffulex": |
| |
| |
| from diffulex import strategy as _strategy |
| from diffulex.diffulex import Diffulex |
|
|
| return Diffulex |
|
|
| if name == "SamplingParams": |
| from diffulex.sampling_params import SamplingParams |
|
|
| return SamplingParams |
|
|
| if name == "get_logger": |
| from diffulex.logger import get_logger |
|
|
| return get_logger |
|
|
| if name == "setup_logger": |
| from diffulex.logger import setup_logger |
|
|
| return setup_logger |
|
|
| if name == "LoggerMixin": |
| from diffulex.logger import LoggerMixin |
|
|
| return LoggerMixin |
|
|
| raise AttributeError(name) |
|
|
|
|
| __all__ = ["Diffulex", "SamplingParams", "get_logger", "setup_logger", "LoggerMixin"] |
|
|