Spaces:
Runtime error
Runtime error
| """Experiment tracking configuration for the application.""" | |
| import os | |
| from dotenv import load_dotenv | |
| from app.utils.logging_config import get_logger | |
| logger = get_logger(__name__) | |
| def init_wandb() -> None: | |
| """Initialize Weave with the WANDB_PROJECT environment variable.""" | |
| try: | |
| import weave | |
| except ImportError: | |
| logger.warning("Weave is not installed. Experiment tracking will not be available.") | |
| return | |
| load_dotenv() | |
| from pathlib import Path | |
| if "WANDB_API_KEY" not in os.environ: | |
| print("[init_wandb] WANDB_API_KEY is not set. Experiment tracking will not be available.") | |
| print(f"[init_wandb] {Path(__file__).parent.parent}") | |
| weave.init(os.environ.get("WANDB_PROJECT", "default")) | |