in experiments/arena/config/default.py [0:0]
def __post_init__(self):
"""Validates the configuration variables after initialization."""
if not self.PROJECT_ID:
raise ValueError("PROJECT_ID environment variable is not set.")
if not self.GENMEDIA_BUCKET:
raise ValueError("GENMEDIA_BUCKET environment variable is not set.")
if not self.MODEL_FLUX1_ENDPOINT_ID:
print("MODEL_FLUX1_ENDPOINT_ID environment variable is not set. List of models will exclude flux1") # Optional: List of models will exclude flux1
if not self.MODEL_STABLE_DIFFUSION_ENDPOINT_ID:
print("MODEL_STABLE_DIFFUSION_ENDPOINT_ID environment variable is not set. List of models will exclude stable diffusion")
if self.ELO_K_FACTOR <= 0:
raise ValueError("ELO_K_FACTOR must be a positive integer.")
if not self.IMAGE_FIREBASE_DB:
raise ValueError("IMAGE_FIREBASE_DB environment variable is not set. Default will be used")
if not self.IMAGE_COLLECTION_NAME:
raise ValueError("IMAGE_COLLECTION_NAME environment variable is not set.")
valid_locations = ["us-central1", "us-east4", "europe-west4", "asia-east1"] # example locations
if self.LOCATION not in valid_locations:
print(f"Warning: LOCATION {self.LOCATION} may not be valid.")
print("Configuration validated successfully.")