| # 🔧 ZeroGPU Plan Pro Fix - NTIA Space |
|
|
| ## 📋 Problema Resuelto |
|
|
| El Space NTIA estaba usando el **plan gratuito de ZeroGPU** (`gpu.t4.micro`) en lugar del **plan Pro** (`gpu.h200.micro`), causando errores "GPU task aborted". |
|
|
| ## ✅ Correcciones Implementadas |
|
|
| ### 1. **Decoradores ZeroGPU Corregidos** |
|
|
| **Antes:** |
| ```python |
| @spaces.GPU(compute_unit="gpu.t4.micro", timeout=30) |
| @spaces.GPU(compute_unit="gpu.t4.micro", timeout=60) |
| ``` |
|
|
| **Después:** |
| ```python |
| @spaces.GPU(compute_unit="gpu.h200.micro", timeout=30) # Plan Pro: H200 |
| @spaces.GPU(compute_unit="gpu.h200.micro", timeout=60) # Plan Pro: H200 |
| ``` |
|
|
| ### 2. **Configuración de Verificación** |
|
|
| Agregado al `app.py`: |
| ```python |
| # Configuración específica para ZeroGPU Plan Pro |
| print("🔧 Configurando ZeroGPU Plan Pro...") |
| print("📊 Plan Pro: H200 con 25 minutos/día") |
| print("🎯 Compute Unit: gpu.h200.micro") |
| |
| # Verificar plan Pro |
| if torch.cuda.is_available(): |
| gpu_name = torch.cuda.get_device_name(0) |
| if "H200" in gpu_name: |
| print("✅ ZeroGPU H200 detectado - Plan Pro activo") |
| ``` |
|
|
| ### 3. **Funciones de Verificación** |
|
|
| ```python |
| def check_auth(): # Verificar autenticación |
| def check_quota(): # Verificar estado de cuota |
| def get_space_status(): # Estado completo del Space |
| ``` |
|
|
| ## 📊 Comparación de Planes |
|
|
| | Característica | Plan Gratuito | Plan Pro | |
| |----------------|---------------|----------| |
| | GPU | T4 | H200 | |
| | Memoria | 16GB | 69.5GB | |
| | Velocidad | Estándar | 3x más rápido | |
| | Compute Unit | `gpu.t4.micro` | `gpu.h200.micro` | |
|
|
| ## 🔧 Configuración Requerida |
|
|
| ### Variables de Entorno del Space: |
| ``` |
| HF_TOKEN=tu_token_aqui |
| SPACES_GPU_TIMEOUT=30 |
| SPACES_GPU_MEMORY=8 |
| ``` |
|
|
| ### Plan Pro Activo: |
| - Verificar en Settings → Billing |
| - ZeroGPU Plan Pro debe estar activo |
|
|
| ## 🚀 Optimizaciones |
|
|
| ### Configuración H200: |
| - ⚡ `torch.float16` para velocidad |
| - 🔧 Optimizaciones CUDA habilitadas |
| - 🎯 Configuración específica para H200 |
|
|
| ### Timeouts Optimizados: |
| - 🎨 Imágenes: 30 segundos |
| - 🎬 Videos: 60 segundos |
|
|
| ### Parámetros Optimizados: |
| - SDXL Turbo: 1 paso, guidance=0.0 |
| - SD Turbo: 2 pasos, guidance≤1.0 |
| - Modelos estándar: 15 pasos máximo |
|
|
| ## 📁 Archivos Modificados |
|
|
| 1. **`app.py`** - Decoradores y configuración principal |
| 2. **`check_zero_gpu_config.py`** - Script de verificación |
| |
| ## 🔍 Verificación |
| |
| ### Script de Verificación: |
| ```bash |
| python check_zero_gpu_config.py |
| ``` |
| |
| ### Logs Esperados: |
| ``` |
| 🔧 Configurando ZeroGPU Plan Pro... |
| 📊 Plan Pro: H200 con 25 minutos/día |
| 🎯 Compute Unit: gpu.h200.micro |
| ✅ ZeroGPU H200 detectado - Plan Pro activo |
| ``` |
| |
| ## ⚠️ Próximos Pasos |
| |
| 1. **Verificar Plan Pro** en Hugging Face |
| 2. **Configurar variables de entorno** del Space |
| 3. **Probar generación** de imágenes/videos |
| 4. **Verificar logs** del Space |
|
|
| ## 📞 Troubleshooting |
|
|
| ### Error: "GPU task aborted" |
| - Verificar plan Pro en Hugging Face |
| - Confirmar variables de entorno del Space |
|
|
| ### Error: "Cuota agotada" |
| - Verificar tiempo restante del plan Pro |
| - Esperar reinicio diario de cuota |
|
|
| --- |
|
|
| **Estado:** ✅ Correcciones implementadas y desplegadas |
| **Space:** https://huggingface.co/spaces/Ntdeseb/ntia |