Spaces:
Running
Running
| ο»Ώ# OmniAvatar-14B Setup Script for Windows | |
| # Downloads all required models using HuggingFace CLI | |
| Write-Host "π OmniAvatar-14B Setup Script" -ForegroundColor Green | |
| Write-Host "===============================================" -ForegroundColor Green | |
| # Check if Python is available | |
| try { | |
| $pythonVersion = python --version 2>$null | |
| Write-Host "β Python found: $pythonVersion" -ForegroundColor Green | |
| } catch { | |
| Write-Host "β Python not found! Please install Python first." -ForegroundColor Red | |
| exit 1 | |
| } | |
| # Check if pip is available | |
| try { | |
| pip --version | Out-Null | |
| Write-Host "β pip is available" -ForegroundColor Green | |
| } catch { | |
| Write-Host "β pip not found! Please ensure pip is installed." -ForegroundColor Red | |
| exit 1 | |
| } | |
| # Install huggingface-cli if not available | |
| Write-Host "π¦ Checking HuggingFace CLI..." -ForegroundColor Yellow | |
| try { | |
| huggingface-cli --version | Out-Null | |
| Write-Host "β HuggingFace CLI already available" -ForegroundColor Green | |
| } catch { | |
| Write-Host "π¦ Installing HuggingFace CLI..." -ForegroundColor Yellow | |
| pip install "huggingface_hub[cli]" | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "β Failed to install HuggingFace CLI" -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "β HuggingFace CLI installed" -ForegroundColor Green | |
| } | |
| # Create directories | |
| Write-Host "π Creating directory structure..." -ForegroundColor Yellow | |
| $directories = @( | |
| "pretrained_models", | |
| "pretrained_models\Wan2.1-T2V-14B", | |
| "pretrained_models\OmniAvatar-14B", | |
| "pretrained_models\wav2vec2-base-960h", | |
| "outputs" | |
| ) | |
| foreach ($dir in $directories) { | |
| New-Item -Path $dir -ItemType Directory -Force | Out-Null | |
| Write-Host "β Created: $dir" -ForegroundColor Green | |
| } | |
| # Model information | |
| $models = @( | |
| @{ | |
| Name = "Wan2.1-T2V-14B" | |
| Repo = "Wan-AI/Wan2.1-T2V-14B" | |
| Description = "Base model for 14B OmniAvatar model" | |
| Size = "~28GB" | |
| LocalDir = "pretrained_models\Wan2.1-T2V-14B" | |
| }, | |
| @{ | |
| Name = "OmniAvatar-14B" | |
| Repo = "OmniAvatar/OmniAvatar-14B" | |
| Description = "LoRA and audio condition weights" | |
| Size = "~2GB" | |
| LocalDir = "pretrained_models\OmniAvatar-14B" | |
| }, | |
| @{ | |
| Name = "wav2vec2-base-960h" | |
| Repo = "facebook/wav2vec2-base-960h" | |
| Description = "Audio encoder" | |
| Size = "~360MB" | |
| LocalDir = "pretrained_models\wav2vec2-base-960h" | |
| } | |
| ) | |
| Write-Host "" | |
| Write-Host "β οΈ WARNING: This will download approximately 30GB of models!" -ForegroundColor Yellow | |
| Write-Host "Make sure you have sufficient disk space and a stable internet connection." -ForegroundColor Yellow | |
| Write-Host "" | |
| $response = Read-Host "Continue with download? (y/N)" | |
| if ($response.ToLower() -ne 'y') { | |
| Write-Host "β Download cancelled by user" -ForegroundColor Red | |
| exit 0 | |
| } | |
| # Download models | |
| foreach ($model in $models) { | |
| Write-Host "" | |
| Write-Host "π₯ Downloading $($model.Name) ($($model.Size))..." -ForegroundColor Cyan | |
| Write-Host "π $($model.Description)" -ForegroundColor Gray | |
| # Check if already exists | |
| if ((Test-Path $model.LocalDir) -and (Get-ChildItem $model.LocalDir -Force | Measure-Object).Count -gt 0) { | |
| Write-Host "β $($model.Name) already exists, skipping..." -ForegroundColor Green | |
| continue | |
| } | |
| # Download model | |
| $cmd = "huggingface-cli download $($model.Repo) --local-dir $($model.LocalDir)" | |
| Write-Host "π Running: $cmd" -ForegroundColor Gray | |
| Invoke-Expression $cmd | |
| if ($LASTEXITCODE -eq 0) { | |
| Write-Host "β $($model.Name) downloaded successfully!" -ForegroundColor Green | |
| } else { | |
| Write-Host "β Failed to download $($model.Name)" -ForegroundColor Red | |
| exit 1 | |
| } | |
| } | |
| Write-Host "" | |
| Write-Host "π OmniAvatar-14B setup completed successfully!" -ForegroundColor Green | |
| Write-Host "" | |
| Write-Host "π‘ Next steps:" -ForegroundColor Yellow | |
| Write-Host "1. Run your app: python app.py" -ForegroundColor White | |
| Write-Host "2. The app will now support full avatar video generation!" -ForegroundColor White | |
| Write-Host "3. Use the Gradio interface or API endpoints" -ForegroundColor White | |
| Write-Host "" | |
| Write-Host "π For more information visit:" -ForegroundColor Yellow | |
| Write-Host " https://huggingface.co/OmniAvatar/OmniAvatar-14B" -ForegroundColor Cyan | |