Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
import plotly.express as pxç
|
4 |
+
|
5 |
+
|
6 |
+
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]}
|
7 |
+
|
8 |
+
|
9 |
+
def display_plot():
|
10 |
+
df = pd.DataFrame(DATA, index=["model-1", "model-2"])
|
11 |
+
fig = px.line_polar(
|
12 |
+
df.melt(ignore_index=False, var_name="Benchmark", value_name="Score").reset_index(names="Model"),
|
13 |
+
r="Score", theta="Benchmark", color="Model",
|
14 |
+
line_close=True,
|
15 |
+
range_r=[0, 1],
|
16 |
+
color_discrete_sequence=["#FF9D00", "#32343D"],
|
17 |
+
)
|
18 |
+
return fig
|
19 |
+
|
20 |
+
|
21 |
+
with gr.Blocks() as demo:
|
22 |
+
plot = gr.Plot()
|
23 |
+
btn = gr.Button()
|
24 |
+
|
25 |
+
btn.click(
|
26 |
+
fn=display_plot,
|
27 |
+
outputs=plot,
|
28 |
+
)
|