Spaces:
Running
Running
| """Shared environment loading for the submission root.""" | |
| from __future__ import annotations | |
| from functools import lru_cache | |
| from pathlib import Path | |
| def load_env_file() -> None: | |
| """Load `red_teaming_env/.env` when python-dotenv is available.""" | |
| env_path = Path(__file__).resolve().parent / ".env" | |
| if not env_path.exists(): | |
| return | |
| try: | |
| from dotenv import load_dotenv | |
| except Exception: | |
| return | |
| load_dotenv(env_path, override=False) | |