import time import gradio as gr import pandas as pd from dotenv import load_dotenv from fastapi import FastAPI load_dotenv() app = FastAPI() LEADERBOARD_PATH = "leaderboard_personal.csv" def create_leaderboard_ui(): """Create the leaderboard UI with caching.""" df = pd.read_csv(LEADERBOARD_PATH) df_html = df.to_html(classes="leaderboard-table", border=0, index=False) return f"""
{df_html}
""" with gr.Blocks(theme=gr.themes.Default()) as demo: with gr.Column(scale=1): gr.Markdown("# 🏆 Leaderboard Personal Retos Hackathon 2025") leaderboard_html = gr.HTML(create_leaderboard_ui) gr.mount_gradio_app(app, demo, path="/") if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=7860)