File size: 1,935 Bytes
8474f02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Pre-deployment checklist for HF Space
"""

import os
import sys
from pathlib import Path

def check_deployment_ready():
    """Check if everything is ready for HF deployment"""
    
    print("πŸ” Pre-deployment checklist:\n")
    
    checks = []
    
    # Check files exist
    required_files = [
        "app.py",
        "run_evaluation.py", 
        "requirements.txt",
        ".env.example",
        "run_hf_space.py",
        "official_config.yaml"
    ]
    
    for file in required_files:
        if Path(file).exists():
            checks.append((f"βœ… {file} exists", True))
        else:
            checks.append((f"❌ {file} missing", False))
    
    # Check API directories
    if Path("apis").is_dir() and list(Path("apis").glob("*.py")):
        checks.append(("βœ… APIs directory configured", True))
    else:
        checks.append(("❌ APIs directory missing or empty", False))
    
    # Check benchmarks directory  
    if Path("benchmarks").is_dir() and Path("benchmarks/gpqa_benchmark.py").exists():
        checks.append(("βœ… GPQA benchmark implementation found", True))
    else:
        checks.append(("❌ GPQA benchmark missing", False))
    
    # Check for sensitive data
    if Path(".env").exists():
        checks.append(("⚠️  .env file exists - make sure it's in .gitignore!", None))
    
    # Print results
    for check, status in checks:
        print(check)
    
    all_good = all(status is not False for _, status in checks)
    
    if all_good:
        print("\nβœ… Ready for deployment!")
        print("\nNext steps:")
        print("1. Set GROK_API_KEY and HF_TOKEN in HF Space secrets")
        print("2. Make sure you have GPQA dataset access")
        print("3. Push to Hugging Face")
    else:
        print("\n❌ Issues found - please fix before deploying")
        
    return all_good

if __name__ == "__main__":
    check_deployment_ready()