Spaces:
Sleeping
Sleeping
Download config.py from kaurdotai/scripti: direct link, hf CLI and curl.
- Browser
- Download file 979 Bytes
-
https://huggingface.co/spaces/kaurdotai/scripti/resolve/main/config.py
- Command line
-
hf download hf://spaces/kaurdotai/scripti/config.py
-
curl -L -o config.py https://huggingface.co/spaces/kaurdotai/scripti/resolve/main/config.py
979 Bytes
| # config.py | |
| from pathlib import Path | |
| from pydantic_settings import BaseSettings | |
| from functools import lru_cache | |
| class Settings(BaseSettings): | |
| # Base configuration | |
| ENVIRONMENT: str = "local" | |
| DEBUG: bool = False | |
| DATA_DIR: Path = Path("./data") | |
| # API Keys and External Services | |
| SAMBANOVA_API_KEY: str | |
| PUSH_TO_HUB: bool = False | |
| # Paths and Files | |
| DATA_FILE: Path = DATA_DIR / "logged_data.csv" | |
| def __init__(self, **kwargs): | |
| super().__init__(**kwargs) | |
| # Set data file based on environment | |
| if not self.DATA_FILE: | |
| self.DATA_FILE = self.DATA_DIR / f"feedback_{self.ENVIRONMENT}.csv" | |
| # Ensure data directory exists | |
| self.DATA_DIR.mkdir(parents=True, exist_ok=True) | |
| class Config: | |
| env_file = ".env" | |
| env_file_encoding = "utf-8" | |
| def get_settings(): | |
| """Cached settings to avoid reading .env file multiple times""" | |
| return Settings() |