Spaces:
Running
Running
import gradio as gr | |
from gradio_leaderboard import Leaderboard | |
from pathlib import Path | |
import pandas as pd | |
from src.styles import custom_css, polygon_svg | |
from src.structures.leaderboard_structure import (LB_LLMZSZL, | |
ORDER_LIST, | |
DATA_TYPES, | |
COLUMN_HEADERS, | |
filter_data, | |
filter_columns, | |
) | |
from src.structures.gim import GIM_SCORES | |
from src.structures.zaw import ZAW_SCORES | |
from src.structures.mat import MAT_SCORES | |
from src.structures.osm import OSM_SCORES | |
global data_component | |
from src.abouts import * | |
main = gr.Blocks(css=custom_css) | |
with main: | |
with gr.Row(): | |
with gr.Column(): | |
gr.HTML(polygon_svg) | |
with gr.Column(): | |
gr.HTML(HEADER_TITLE) | |
with gr.Tabs(elem_classes="tab-buttons") as tabs: | |
with gr.Tab("🏅 LLMZSZL"): | |
gr.Markdown(MAIN_DESC) | |
# Checkbox to toggle column visibility | |
columns_selector = gr.CheckboxGroup( | |
choices=ORDER_LIST, | |
label="Select columns to display", | |
value=ORDER_LIST, | |
) | |
# Dataframe component to display the leaderboard data | |
data_component = gr.components.Dataframe( | |
value=LB_LLMZSZL, | |
headers=COLUMN_HEADERS, | |
type="pandas", | |
datatype=DATA_TYPES, | |
interactive=False, | |
visible=True, | |
column_widths=[400, 200, 100, 120, 100] | |
) | |
# def update_data(selected_columns, selected_languages): | |
# return update_dataframe(selected_columns, selected_languages) | |
def update_dataframe(selected_columns): | |
return filter_columns(selected_columns) | |
columns_selector.change(update_dataframe, inputs=columns_selector, outputs=data_component) | |
# language_selector.change(update_data, inputs=[columns_selector, language_selector], outputs=data_component) | |
with gr.Tab("📝 Middle School exam"): | |
gr.Markdown(GIM_DESC) | |
data_component = gr.components.Dataframe( | |
value=GIM_SCORES, | |
type="pandas", | |
interactive=False, | |
visible=True, | |
datatype=["markdown"]+["number"]*18, | |
column_widths=[400] + [80] * 18 | |
) | |
with gr.Tab("📝 8-grade exam"): | |
gr.Markdown(OSM_DESC) | |
data_component = gr.components.Dataframe( | |
value=OSM_SCORES, | |
type="pandas", | |
interactive=False, | |
visible=True, | |
datatype=["markdown"]+["number"]*5, | |
column_widths=[400] + [80] * 5 | |
) | |
with gr.Tab("📝 High School exam"): | |
gr.Markdown(MAT_DESC) | |
data_component = gr.components.Dataframe( | |
value=MAT_SCORES, | |
type="pandas", | |
interactive=False, | |
visible=True, | |
datatype=["markdown"]+["number"]*22, | |
column_widths=[400] + [80] * 22 | |
) | |
with gr.Tab("📝 Professional exam"): | |
gr.Markdown(ZAW_DESC) | |
data_component = gr.components.Dataframe( | |
value=ZAW_SCORES, | |
type="pandas", | |
interactive=False, | |
visible=True, | |
datatype=["markdown"]+["number"]*12, | |
column_widths=[400] + [80] * 12 | |
) | |
with gr.Tab("📝 About"): | |
gr.Markdown(ABOUT) | |
gr.Markdown(DATASET_TABLE) | |
with gr.Column(): | |
with gr.Accordion("📙 Related Work", open=False): | |
citation_button = gr.Textbox( | |
label=CITATION_LABEL, | |
value=CITATION_CONTENT, | |
lines=20, | |
elem_id="citation-button", | |
show_copy_button=True, | |
) | |
gr.Markdown(r""" | |
If this work is useful to you, please consider citing: | |
```bibtex | |
@misc{jassem2025llmzszl, | |
title={LLMzSz{\L}: a comprehensive LLM benchmark for Polish}, | |
author={Krzysztof Jassem and Michał Ciesiółka and Filip Graliński and Piotr Jabłoński and Jakub Pokrywka and Marek Kubis and Monika Jabłońska and Ryszard Staruch}, | |
year={2025}, | |
eprint={2501.02266}, | |
archivePrefix={arXiv}, | |
primaryClass={cs.CL}, | |
url={https://arxiv.org/abs/2501.02266}, | |
} | |
``` | |
""") | |
if __name__ == "__main__": | |
main.launch() | |