48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
"""Application configuration with Pydantic models."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class EscalationConfig(BaseModel):
|
|
"""Escalation engine parameters."""
|
|
rate: float = 0.05
|
|
initial_batch_size: int = 40
|
|
max_images: int = 200
|
|
max_audio_clips: int = 50
|
|
asset_swap_min: float = 0.5 # seconds (at high intensity)
|
|
asset_swap_max: float = 15.0 # seconds (at low intensity)
|
|
voice_mean_interval: float = 60.0 # Poisson mean at intensity 0
|
|
silence_gap_min: float = 2.0
|
|
silence_gap_max: float = 30.0
|
|
fake_calm_chance: float = 0.08 # probability per phase update
|
|
fake_calm_duration_min: float = 10.0
|
|
fake_calm_duration_max: float = 30.0
|
|
cluster_burst_chance: float = 0.1
|
|
cluster_burst_count_min: int = 2
|
|
cluster_burst_count_max: int = 5
|
|
|
|
|
|
class ModelConfig(BaseModel):
|
|
"""AI model identifiers and generation parameters."""
|
|
sdxl_model_id: str = "stabilityai/sdxl-turbo"
|
|
sdxl_steps: int = 4
|
|
sdxl_guidance_scale: float = 0.0
|
|
sdxl_width: int = 512
|
|
sdxl_height: int = 512
|
|
xtts_model: str = "tts_models/multilingual/multi-dataset/xtts_v2"
|
|
xtts_language: str = "en"
|
|
|
|
|
|
class AppConfig(BaseModel):
|
|
"""Top-level application config."""
|
|
host: str = "0.0.0.0"
|
|
port: int = 8400
|
|
device: str = "cuda"
|
|
assets_dir: str = "assets"
|
|
samples_dir: str = "samples"
|
|
escalation: EscalationConfig = Field(default_factory=EscalationConfig)
|
|
models: ModelConfig = Field(default_factory=ModelConfig)
|
|
|
|
|
|
config = AppConfig()
|