Spaces:
Runtime error
Runtime error
Download app/config.py from devmurtaza/RastaAI: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/spaces/devmurtaza/RastaAI/resolve/main/app/config.py
- Command line
-
hf download hf://spaces/devmurtaza/RastaAI/app/config.py
-
curl -L -o config.py https://huggingface.co/spaces/devmurtaza/RastaAI/resolve/main/app/config.py
1.52 kB
| """Application settings loaded from environment variables.""" | |
| from functools import lru_cache | |
| from typing import List | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| from pydantic import Field | |
| class Settings(BaseSettings): | |
| model_config = SettingsConfigDict( | |
| env_file=".env", env_file_encoding="utf-8", extra="ignore" | |
| ) | |
| # App | |
| app_env: str = "development" | |
| log_level: str = "INFO" | |
| api_v1_prefix: str = "/api/v1" | |
| cors_origins: List[str] = Field(default_factory=lambda: ["*"]) | |
| # Database | |
| database_url: str = "postgresql+asyncpg://rasta:rasta@localhost:5432/rasta_ai" | |
| sync_database_url: str = "postgresql+psycopg2://rasta:rasta@localhost:5432/rasta_ai" | |
| # Redis | |
| redis_url: str = "redis://localhost:6379/0" | |
| cache_ttl_seconds: int = 300 | |
| # Routing & APIs | |
| osrm_url: str = "https://router.project-osrm.org" | |
| google_maps_api_key: str = "" | |
| openweather_api_key: str = "" | |
| tomtom_api_key: str = "" | |
| # Models | |
| model_dir: str = "app/models/artifacts" | |
| eta_model_path: str = "app/models/artifacts/eta_model.joblib" | |
| fuel_model_path: str = "app/models/artifacts/fuel_model.joblib" | |
| preprocessor_path: str = "app/models/artifacts/preprocessor.joblib" | |
| # Ranking weights (sum should equal 1.0) | |
| w_eta: float = 0.40 | |
| w_traffic: float = 0.25 | |
| w_fuel: float = 0.20 | |
| w_road: float = 0.10 | |
| w_preference: float = 0.05 | |
| def get_settings() -> Settings: | |
| return Settings() | |
| settings = get_settings() | |