Spaces:
Sleeping
Sleeping
| # 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 "" | |