File size: 1,013 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
#!/usr/bin/env python3
"""
Hugging Face Space entry point for GPQA evaluation
"""

import os
import sys
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Set HF token if available
hf_token = os.getenv('HF_TOKEN')
if hf_token:
    os.environ['HUGGING_FACE_HUB_TOKEN'] = hf_token
    print("✅ HF Token configured")

# Import and run the app
from app import create_ui, start_evaluation_safe, check_environment

if __name__ == "__main__":
    # Check environment
    issues = check_environment()
    
    if issues:
        print("\n⚠️  Configuration issues:")
        for issue in issues:
            print(f"   - {issue}")
        print("\nThe app will run in demo mode.")
        print("To enable GPQA evaluation, please set the required secrets in HF Space settings.")
    else:
        print("✅ All environment variables configured")
        # Start evaluation in background
        start_evaluation_safe()
    
    # Create and launch UI
    ui = create_ui()
    ui.launch()