File size: 2,048 Bytes
8d8ad99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Script para verificar el estado del Space NTIA directamente
"""

import requests
import json
import os

def check_space_status():
    """Verificar el estado del Space NTIA"""
    print("🔍 Verificando estado del Space NTIA...")
    print("=" * 60)
    
    # URL del Space
    space_url = "https://ntdeseb-ntia.hf.space"
    
    try:
        # Verificar si el Space está activo
        response = requests.get(space_url, timeout=10)
        print(f"✅ Space activo: {response.status_code}")
        
        # Verificar la API del Space
        api_url = f"{space_url}/api/predict/"
        response = requests.get(api_url, timeout=10)
        print(f"✅ API disponible: {response.status_code}")
        
        # Intentar obtener el estado del Space
        status_url = f"{space_url}/api/predict/get_space_status"
        response = requests.post(status_url, json={}, timeout=10)
        
        if response.status_code == 200:
            data = response.json()
            print("📊 Estado del Space:")
            print(f"   - Autenticación: {data.get('authentication', {}).get('authenticated', 'N/A')}")
            print(f"   - GPU: {data.get('quota', {}).get('gpu_type', 'N/A')}")
            print(f"   - Plan: {data.get('quota', {}).get('plan', 'N/A')}")
            print(f"   - Cuota disponible: {data.get('quota', {}).get('quota_available', 'N/A')}")
        else:
            print(f"❌ No se pudo obtener estado: {response.status_code}")
            
    except Exception as e:
        print(f"❌ Error verificando Space: {e}")
    
    print("\n💡 Recomendaciones:")
    print("1. Verifica que tengas el plan Pro activo en Hugging Face")
    print("2. Configura las variables de entorno del Space:")
    print("   - HF_TOKEN=tu_token_aqui")
    print("   - SPACES_GPU_TIMEOUT=30")
    print("   - SPACES_GPU_MEMORY=8")
    print("3. Ve a Settings → Billing en Hugging Face")
    print("4. Asegúrate de tener ZeroGPU Plan Pro activo")

if __name__ == "__main__":
    check_space_status()