Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
# Add this at the top of your script | |
import warnings | |
warnings.filterwarnings("ignore") | |
import gradio as gr | |
from data_loader import ( | |
load_data, | |
CATEGORIES, | |
METHODOLOGY, | |
HEADER_CONTENT, | |
CARDS, | |
DATASETS, | |
SCORES, | |
) | |
from tabs.leaderboard import create_leaderboard_tab, filter_leaderboard | |
def create_app(): | |
df = load_data() | |
MODELS = [x.strip() for x in df["Model"].unique().tolist()] | |
with gr.Blocks( | |
theme=gr.themes.Soft(font=[gr.themes.GoogleFont("sans-serif")]) | |
) as app: | |
with gr.Tabs(): | |
# Create tabs | |
lb_output, lb_plot1, lb_plot2 = create_leaderboard_tab( | |
df, CATEGORIES, METHODOLOGY, HEADER_CONTENT, CARDS | |
) | |
# Initial loads | |
app.load( | |
fn=lambda: filter_leaderboard( | |
df, "All", list(CATEGORIES.keys())[0], "Performance" | |
), | |
outputs=[lb_output, lb_plot1, lb_plot2], | |
) | |
return app | |
demo = create_app() | |
demo.launch() | |