personality-chatbot / check_setup.ps1
dianacasti's picture
Initial commit: Multi-personality chatbot
f123c00
Raw
History Blame Contribute Delete
3.65 kB
# Quick Test Script - Verify setup before deployment
Write-Host "πŸ” Checking Multi-Personality Chatbot Setup..." -ForegroundColor Cyan
Write-Host ""
# Check Python
Write-Host "1. Checking Python..." -ForegroundColor Yellow
try {
$pythonVersion = python --version 2>&1
Write-Host " βœ… $pythonVersion" -ForegroundColor Green
} catch {
Write-Host " ❌ Python not found. Install Python 3.8+" -ForegroundColor Red
exit 1
}
# Check adapter folders
Write-Host "`n2. Checking adapter folders..." -ForegroundColor Yellow
$adapters = @(
"qwen-brainrot-lora-stage1-final",
"pirate-lora-adapter",
"yoda-lora-adapter",
"nerd-lora-adapter"
)
$allFound = $true
foreach ($adapter in $adapters) {
if (Test-Path $adapter) {
$adapterModel = Join-Path $adapter "adapter_model.safetensors"
if (Test-Path $adapterModel) {
$size = (Get-Item $adapterModel).Length / 1MB
Write-Host " βœ… $adapter (${size:N1} MB)" -ForegroundColor Green
} else {
Write-Host " ⚠️ $adapter folder exists but missing adapter_model.safetensors" -ForegroundColor Yellow
$allFound = $false
}
} else {
Write-Host " ❌ $adapter not found" -ForegroundColor Red
$allFound = $false
}
}
if (-not $allFound) {
Write-Host "`n Some adapters are missing. Make sure all adapter folders are present." -ForegroundColor Red
}
# Check requirements
Write-Host "`n3. Checking dependencies..." -ForegroundColor Yellow
$packages = @("gradio", "torch", "transformers", "peft", "accelerate", "safetensors")
$missingPackages = @()
foreach ($pkg in $packages) {
try {
$result = python -c "import $pkg; print($pkg.__version__)" 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " βœ… $pkg ($result)" -ForegroundColor Green
} else {
Write-Host " ❌ $pkg not installed" -ForegroundColor Red
$missingPackages += $pkg
}
} catch {
Write-Host " ❌ $pkg not installed" -ForegroundColor Red
$missingPackages += $pkg
}
}
if ($missingPackages.Count -gt 0) {
Write-Host "`n Missing packages detected. Install with:" -ForegroundColor Yellow
Write-Host " pip install -r requirements.txt" -ForegroundColor Cyan
}
# Check files
Write-Host "`n4. Checking project files..." -ForegroundColor Yellow
$files = @("app.py", "test_model.py", "requirements.txt", "README.md", "README_DEPLOYMENT.md")
foreach ($file in $files) {
if (Test-Path $file) {
Write-Host " βœ… $file" -ForegroundColor Green
} else {
Write-Host " ❌ $file not found" -ForegroundColor Red
}
}
# Summary
Write-Host "`n" + "="*60 -ForegroundColor Cyan
Write-Host "πŸ“‹ SETUP SUMMARY" -ForegroundColor Cyan
Write-Host "="*60 -ForegroundColor Cyan
if ($allFound -and $missingPackages.Count -eq 0) {
Write-Host "βœ… All checks passed! You're ready to:" -ForegroundColor Green
Write-Host ""
Write-Host " Local Testing:" -ForegroundColor Yellow
Write-Host " python app.py" -ForegroundColor White
Write-Host ""
Write-Host " Deploy to Hugging Face:" -ForegroundColor Yellow
Write-Host " See README_DEPLOYMENT.md for instructions" -ForegroundColor White
} else {
Write-Host "⚠️ Setup incomplete. Please:" -ForegroundColor Yellow
if ($missingPackages.Count -gt 0) {
Write-Host " 1. Install dependencies: pip install -r requirements.txt" -ForegroundColor White
}
if (-not $allFound) {
Write-Host " 2. Ensure all adapter folders are present" -ForegroundColor White
}
}
Write-Host ""