File size: 2,518 Bytes
29191d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MTEB Leaderboard - Loading</title>
    <!-- Semi Design CSS -->
    <link rel="stylesheet" href="https://unpkg.com/@douyinfe/semi-ui/dist/css/semi.min.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="{{ url_for('static', path='css/style.css') }}">
    <style>
        .loading-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            text-align: center;
            padding: 20px;
        }
        
        .loading-spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3498db;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 20px 0;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            font-size: 1.2em;
            margin: 10px 0;
        }
        
        #loading-status {
            color: #666;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="loading-container">
        <h1>MTEB Leaderboard</h1>
        <div class="loading-spinner"></div>
        <p class="loading-text">Loading data...</p>
        <p id="loading-status">Please wait while we initialize the service</p>
    </div>

    <script>
        async function checkStatus() {
            try {
                const response = await fetch('/health');
                const data = await response.json();
                
                if (data.initialized) {
                    window.location.reload();
                } else {
                    const status = document.getElementById('loading-status');
                    if (data.status === 'initializing') {
                        status.textContent = `Initializing... (${Math.round(data.elapsed_time)}s)`;
                    } else {
                        status.textContent = 'Waiting for initialization...';
                    }
                }
            } catch (error) {
                console.error('Error checking status:', error);
            }
        }

        // Check status every 2 seconds
        setInterval(checkStatus, 2000);
    </script>
</body>
</html>