|
|
|
|
|
|
|
|
|
|
|
Write-Host "===================================================" -ForegroundColor Cyan |
|
|
Write-Host "🚀 Starting ModelX Anomaly Detection Pipeline" -ForegroundColor Cyan |
|
|
Write-Host "===================================================" |
|
|
|
|
|
|
|
|
Write-Host "[1/3] Checking dependencies..." -ForegroundColor Yellow |
|
|
$ModelPath = "models\anomaly-detection\models_cache\lid.176.bin" |
|
|
if (-not (Test-Path $ModelPath)) { |
|
|
Write-Host "⚠️ WARNING: FastText model not found in $ModelPath" -ForegroundColor Red |
|
|
Write-Host " Please download it from: https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin" -ForegroundColor Gray |
|
|
} |
|
|
|
|
|
|
|
|
Write-Host "[2/3] Starting Vectorization Agent API..." -ForegroundColor Yellow |
|
|
Write-Host " - Port: 8001" -ForegroundColor Gray |
|
|
|
|
|
|
|
|
$ApiProcess = Start-Process python -ArgumentList "src\api\vectorization_api.py" -PassThru -WindowStyle Minimized |
|
|
Write-Host " ✅ API started with PID: $($ApiProcess.Id)" -ForegroundColor Green |
|
|
|
|
|
|
|
|
Start-Sleep -Seconds 5 |
|
|
|
|
|
|
|
|
Write-Host "[3/3] Starting Apache Airflow (Astro)..." -ForegroundColor Yellow |
|
|
Write-Host " - Dashboard: http://localhost:8080" -ForegroundColor Gray |
|
|
|
|
|
Set-Location "models\anomaly-detection" |
|
|
|
|
|
|
|
|
if (Get-Command "astro" -ErrorAction SilentlyContinue) { |
|
|
astro dev start |
|
|
} else { |
|
|
Write-Host "❌ Error: 'astro' command not found. Please install Astronomer CLI." -ForegroundColor Red |
|
|
Stop-Process -Id $ApiProcess.Id -Force |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write-Host "Press any key to stop services..." -ForegroundColor Cyan |
|
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") |
|
|
|
|
|
|
|
|
Write-Host "🛑 Stopping services..." -ForegroundColor Yellow |
|
|
Stop-Process -Id $ApiProcess.Id -Force -ErrorAction SilentlyContinue |
|
|
Write-Host "✅ Services stopped." -ForegroundColor Green |
|
|
|