Spaces:
Running
Running
| """ | |
| 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 | |
| ) | |