File size: 677 Bytes
0ca63f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Optional

import os

try:
    # Pydantic v1 style
    from pydantic import BaseSettings
except ImportError:  # pragma: no cover - fallback for Pydantic v2 installs
    from pydantic_settings import BaseSettings  # type: ignore


class Settings(BaseSettings):
    """
    Application configuration loaded from environment variables.
    """

    DATABASE_URL: str = os.getenv(
        "DATABASE_URL",
        "sqlite:///./sundew_health.db",
    )
    MODEL_WEIGHTS_PATH: Optional[str] = os.getenv("MODEL_WEIGHTS_PATH", "./checkpoints/ecg_classifier.pt")

    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"


settings = Settings()