File size: 3,363 Bytes
26f8b9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Quick Deployment Script for New HF Space
# Run this after creating your new Space on HuggingFace

param(
    [Parameter(Mandatory=$true)]
    [string]$SpaceURL,
    
    [Parameter(Mandatory=$false)]
    [string]$SpaceName = "game-asset-generator-pro-v2"
)

Write-Host "๐Ÿš€ Deploying to HF Space: $SpaceName" -ForegroundColor Cyan
Write-Host ""

# Check if we're in the right directory
if (-not (Test-Path "app.py")) {
    Write-Host "โŒ Error: app.py not found" -ForegroundColor Red
    Write-Host "   Run this script from huggingface-space-v2/" -ForegroundColor Yellow
    exit 1
}

# Create temporary deployment directory
$deployDir = "deploy_temp"
Write-Host "๐Ÿ“ Creating deployment directory..." -ForegroundColor Green
New-Item -ItemType Directory -Force -Path $deployDir | Out-Null

# Copy all necessary files
Write-Host "๐Ÿ“ฆ Copying files..." -ForegroundColor Green
$filesToCopy = @(
    "app.py",
    "requirements.txt",
    "Dockerfile",
    ".gitignore",
    "README.md",
    "core",
    "generators",
    "processors",
    "utils",
    "scripts"
)

foreach ($item in $filesToCopy) {
    if (Test-Path $item) {
        Copy-Item -Recurse -Force $item $deployDir/
        Write-Host "   โœ… Copied: $item" -ForegroundColor Gray
    } else {
        Write-Host "   โš ๏ธ  Missing: $item" -ForegroundColor Yellow
    }
}

# Create HF Space README header
Write-Host "๐Ÿ“ Creating Space metadata..." -ForegroundColor Green
$readmeHeader = @"
---
title: 3D Asset Generator Pro V2
emoji: ๐ŸŽฎ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
hardware: l4
---

"@

# Prepend to README
$existingReadme = Get-Content "$deployDir/README.md" -Raw
$newReadme = $readmeHeader + $existingReadme
Set-Content -Path "$deployDir/README.md" -Value $newReadme

Write-Host ""
Write-Host "โœจ Deployment package ready in: $deployDir" -ForegroundColor Green
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Cyan
Write-Host "1. Create new Space at: https://huggingface.co/new-space" -ForegroundColor White
Write-Host "   - Name: $SpaceName" -ForegroundColor Gray
Write-Host "   - SDK: Gradio" -ForegroundColor Gray
Write-Host "   - Hardware: L4 GPU" -ForegroundColor Gray
Write-Host ""
Write-Host "2. Clone your Space:" -ForegroundColor White
Write-Host "   git clone $SpaceURL" -ForegroundColor Gray
Write-Host ""
Write-Host "3. Copy files:" -ForegroundColor White
Write-Host "   Copy-Item -Recurse $deployDir\* YOUR_SPACE_DIR\" -ForegroundColor Gray
Write-Host ""
Write-Host "4. Push to HF:" -ForegroundColor White
Write-Host "   cd YOUR_SPACE_DIR" -ForegroundColor Gray
Write-Host "   git add ." -ForegroundColor Gray
Write-Host "   git commit -m 'Initial deployment - Streamlined architecture'" -ForegroundColor Gray
Write-Host "   git push" -ForegroundColor Gray
Write-Host ""
Write-Host "๐Ÿ“Š Package Statistics:" -ForegroundColor Cyan
Write-Host "   Total files: $(Get-ChildItem -Recurse $deployDir | Measure-Object).Count" -ForegroundColor Gray
Write-Host "   Total size: $([math]::Round((Get-ChildItem -Recurse $deployDir | Measure-Object -Property Length -Sum).Sum / 1MB, 2)) MB" -ForegroundColor Gray
Write-Host ""

# Offer to open browser
$openBrowser = Read-Host "Open HuggingFace Spaces in browser? (y/n)"
if ($openBrowser -eq "y") {
    Start-Process "https://huggingface.co/new-space"
}