File size: 2,399 Bytes
ebca337
 
 
5bba573
2101b74
ebca337
5bba573
 
fc68877
 
 
1df4b74
 
ebca337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bba573
4012180
5bba573
8eaaf2d
 
 
 
 
 
ebca337
fc68877
8eaaf2d
ebca337
 
 
 
 
 
 
 
 
 
 
 
 
5bba573
 
 
 
8eaaf2d
5bba573
 
ebca337
 
 
 
 
 
 
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
"""
ESPnet Leaderboard - A Gradio-based leaderboard with multiple tabs and pagination
"""
from dotenv import load_dotenv
import gradio as gr

from espn_ldbd.display.css_html_js import CUSTOM_CSS
from espn_ldbd.display.tabs import (
    create_leaderboard_tab,
    create_submit_tab
)
from espn_ldbd.leaderboard.data import LeaderboardData
from espn_ldbd.leaderboard.dataset import LeaderboardDataset


def create_app():
    """Create the main Gradio application"""

    with gr.Blocks(css=CUSTOM_CSS, title="ESPnet Leaderboard", theme=gr.themes.Soft()) as app:

        # Header
        gr.HTML("""
            <div class="header-text">
                <h1>🎯 ESPnet Leaderboard</h1>
                <p>Comprehensive benchmarks for speech and language processing models</p>
            </div>
        """)

        # Description
        with gr.Row():
            gr.Markdown("""
            Welcome to the **ESPnet Leaderboard**! This platform tracks the performance of various models 
            across different speech and language processing tasks. Navigate through the tabs to explore 
            different task categories.
            """)

        # Create tabs for different tasks
        with gr.Tabs():
            for task in leaderboard_ds.get_tasks:
                print("[App] Making Tab for task: {}".format(task["task_id"]))
                with gr.Tab(task["task_title"]):
                    create_leaderboard_tab(
                        task["task_title"],
                        leaderboard_ds.get_subtasks(task["task_id"]),
                        leaderboard_data,
                        rows_per_page=30
                    )

            with gr.Tab("Request a model"):
                create_submit_tab(leaderboard_ds)

        # Footer
        gr.HTML("""
            <div class="footer-text">
                <p>© 2025 ESPnet Community | Data updated regularly from Hugging Face datasets</p>
            </div>
        """)

    return app


# Create and launch the app
if __name__ == "__main__":
    load_dotenv()
    # Initialize leaderboard data manager
    leaderboard_data = LeaderboardData()
    leaderboard_ds = LeaderboardDataset()
    leaderboard_ds.start_register_submission(minutes=30)

    # Launch app
    app = create_app()
    app.launch(
        server_name="0.0.0.0",
        server_port=7860,
        share=False,
        show_error=True
    )