Spaces:
Sleeping
Sleeping
| # Deployment Script for Atomic VSA | |
| # Usage: .\deploy.ps1 -RepoId "your-username/atomic-vsa" | |
| param ( | |
| [Parameter(Mandatory = $true)] | |
| [string]$RepoId = "marshad180/atomic-vsa", | |
| [string]$RepoType = "space", # space, model, or dataset | |
| [string]$CommitMessage = "Update Atomic VSA deployment" | |
| ) | |
| # Determine CLI to use | |
| $cli = "huggingface-cli" | |
| if (Get-Command "hf" -ErrorAction SilentlyContinue) { | |
| $cli = "hf" | |
| } | |
| elseif (-not (Get-Command "huggingface-cli" -ErrorAction SilentlyContinue)) { | |
| Write-Host "Error: Neither 'hf' nor 'huggingface-cli' is installed." -ForegroundColor Red | |
| Write-Host "Please install it using: pip install -U huggingface_hub" | |
| exit 1 | |
| } | |
| # Optional: Enable faster transfer if available | |
| $env:HF_HUB_ENABLE_HF_TRANSFER = 1 | |
| # Login check (basic) - just verifying command exists | |
| Write-Host "Deploying to Hugging Face $RepoType : $RepoId using '$cli' ..." -ForegroundColor Cyan | |
| # Upload command | |
| # hf upload <repo_id> <local_path> <path_in_repo> --repo-type <type> --commit-message <msg> | |
| & $cli upload $RepoId . . --repo-type $RepoType --commit-message "$CommitMessage" --exclude ".git/*" "deploy.ps1" | |
| if ($LASTEXITCODE -eq 0) { | |
| Write-Host "Deployment Successful! 🚀" -ForegroundColor Green | |
| Write-Host "View your space at: https://huggingface.co/spaces/$RepoId" | |
| } | |
| else { | |
| Write-Host "Deployment Failed." -ForegroundColor Red | |
| } | |