Spaces:
Running
Running
update
Browse files
main.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
import gradio as gr
|
| 5 |
+
import pandas as pd
|
| 6 |
+
from gradio_leaderboard import Leaderboard, SelectColumns, SearchColumns
|
| 7 |
+
|
| 8 |
+
abs_path = Path(__file__).parent
|
| 9 |
+
|
| 10 |
+
df = pd.read_csv("opensci-ref-table.csv")
|
| 11 |
+
|
| 12 |
+
df.drop("#Tokens", axis=1, inplace=True)
|
| 13 |
+
df.drop("AVG", axis=1, inplace=True)
|
| 14 |
+
|
| 15 |
+
benchmarks = df.columns[1:]
|
| 16 |
+
df["Average β¬οΈ"] = df.loc[:, benchmarks].mean(axis=1)
|
| 17 |
+
# df.set_index("Model", inplace=True)
|
| 18 |
+
|
| 19 |
+
with gr.Blocks() as demo:
|
| 20 |
+
gr.Markdown(
|
| 21 |
+
"""
|
| 22 |
+
# π₯ OpenEuroLLM Leaderboard πͺπΊ
|
| 23 |
+
"""
|
| 24 |
+
)
|
| 25 |
+
Leaderboard(
|
| 26 |
+
value=df.round(2),
|
| 27 |
+
select_columns=SelectColumns(
|
| 28 |
+
default_selection=list(df.columns),
|
| 29 |
+
cant_deselect=["Model"],
|
| 30 |
+
label="Select Columns to Display:",
|
| 31 |
+
),
|
| 32 |
+
search_columns=SearchColumns(
|
| 33 |
+
primary_column="Model",
|
| 34 |
+
label="Filter a model",
|
| 35 |
+
secondary_columns=[],
|
| 36 |
+
),
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
if __name__ == "__main__":
|
| 40 |
+
demo.launch()
|