| import gradio as gr | |
| import pandas as pd | |
| import plotly.express as px | |
| DATA = {"BBH": [0.2, 0.7], "GPQA": [0.4, 0.5], "IFEval": [0.6, 0.3], "MATH": [0.2, 0.7], "MMLU-Pro": [0.4, 0.5], "MuSR": [0.6, 0.3]} | |
| def display_plot(): | |
| df = pd.DataFrame(DATA, index=["model-1", "model-2"]) | |
| fig = px.line_polar( | |
| df.melt(ignore_index=False, var_name="Benchmark", value_name="Score").reset_index(names="Model"), | |
| r="Score", theta="Benchmark", color="Model", | |
| line_close=True, | |
| range_r=[0, 1], | |
| color_discrete_sequence=["#FF9D00", "#32343D"], | |
| ) | |
| return fig | |
| with gr.Blocks() as demo: | |
| plot = gr.Plot() | |
| btn = gr.Button() | |
| btn.click( | |
| fn=display_plot, | |
| outputs=plot, | |
| ) | |
| demo.launch() | |