ml_pipeline_cookiecutter/{{cookiecutter.project_name}}/{{cookiecutter.module_name}}/__init__.py

22 lines
924 B
Python
Raw Permalink Normal View History

2024-04-06 13:02:31 -07:00
from config import ConfigurationSet, config_from_env, config_from_dotenv, config_from_toml
from pathlib import Path
pwd = Path(__file__).parent
config_path = pwd / 'config'
root_path = pwd.parent
config = ConfigurationSet(
config_from_env(prefix="{{cookiecutter.module_name.upper()}}", separator="__", lowercase_keys=True),
2024-04-06 13:02:31 -07:00
config_from_dotenv(root_path / ".env", read_from_file=True, lowercase_keys=True, interpolate=True, interpolate_type=1),
config_from_toml(config_path / "training.toml", read_from_file=True),
config_from_toml(config_path / "data.toml", read_from_file=True),
config_from_toml(config_path / "model.toml", read_from_file=True),
config_from_toml(config_path / "app.toml", read_from_file=True),
config_from_toml(config_path / "paths.toml", read_from_file=True),
)
import logging
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)